• Resolved harryfear

    (@harryfear)


    Hi!

    Is there any way to send CloudFlare a “stale-if-error” value?

    I’d use something like 10 minutes (600 seconds).

    It would act as a kind of ‘always online’ when server is installing upgrades?

    I think it help avoid 521 errors:
    https://ibb.co/0frsfVq

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    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.

    Thread Starter harryfear

    (@harryfear)

    Hi Saumya,

    Thank you so much for a detailed response, which is really kind and helpful.

    In this case, I’ll try to use the Always Online feature within CloudFlare.

    Have a great weekend. You are the caching oracle!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘stale-if-error’ is closed to new replies.