I noticed that the current Cache-Control header is: public, max-age=31536000, immutable.
I wonder if max-age=31536000, public, stale-if-error=31536000, stale-while-revalidate=31536000, immutable would be better.
The additions are stale-if-error=31536000 and stale-while-revalidate=31536000.
stale-while-revalidate will make Cloudflare revalidate asynchronously in the background, if the resource needs revalidation.
stale-if-error will serve cached content when a request to the origin fails.
Note: The header must be accompanied by the appropriate CDN configuration for the desired effect.
For Cloudflare, this is in Cache Rules.
Make sure that Do not serve stale content while updating is set to off.
I noticed that the current
Cache-Controlheader is:public, max-age=31536000, immutable.I wonder if
max-age=31536000, public, stale-if-error=31536000, stale-while-revalidate=31536000, immutablewould be better.The additions are
stale-if-error=31536000andstale-while-revalidate=31536000.stale-while-revalidatewill make Cloudflare revalidate asynchronously in the background, if the resource needs revalidation.stale-if-errorwill serve cached content when a request to the origin fails.Note: The header must be accompanied by the appropriate CDN configuration for the desired effect.
For Cloudflare, this is in
Cache Rules.Make sure that
Do not serve stale content while updatingis set tooff.