1

We have a Apache httpd with mod_cache/mod_disk_cache enabled. By default the directive CacheStaleOnError is activated. The documentatn states:

When the CacheStaleOnError directive is switched on, and when stale data is available in the cache, the cache will respond to 5xx responses from the backend by returning the stale data instead of the 5xx response.

That's our desired behaviour.

Additionally we want to serve a custom error page when there's no (stale) cache data add all to serve for a specific request. So we defined an ErrorDocument for every status of the 5xx class.

As I couldn't come up with an reliable test scenario, my question is: what will happen when cached data for a specific request is stale and a 5xx error occures while requesting the backend?

Does httpd serve the stale data? Or does it serve the configured custom error page? How is that prioritised?

ahaertig
  • 65
  • 1
  • 6

0 Answers0