Unfortunately, the stale-if-error
directive is not automatically added by the plugin due to many issues that it has. Also, it doesn’t work in the worker mode.
Currently, if you would like to use it you have to edit the plugin code and add that into the code.
Moreover, Error 521 generally means an issue with the origin server. So, I think it is better to look into why the origin server is not serving the response. Moreover, imagine a case where the Cloudflare server doesn’t have the page cached in it’s system – in that case even stale won’t help and it will fallback to fetching the content form the origin server.
So, better to look into why origin server is not working as expected. At the time of building the plugin we have tried all possible cache-control directives and from what I have seen stale-if-error
didn’t help much despite creating issues in some occasions. So, we decided not to use it in the code.
Finally you can also enable always online option in the Cloudflare dashboard which will do exactly what you are looking for.