-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Backend (Server)Related to the server-side (includes PHP, HTML, etc).Related to the server-side (includes PHP, HTML, etc).
Milestone
Description
https://caniuse.com/mdn-http_headers_cache-control_stale-if-error
When this is supported, I'm thinking we only incorporate it into static files like images and fonts. Maybe CSS too.
<FilesMatch "\.(ico|pdf|flv|png|gif|jpg|jpeg|svg|woff|woff2|mp3|css)$">
Header set Cache-Control "max-age=31536000, stale-while-revalidate=2592000, stale-if-error=86400, public"
</FilesMatch>
The above would have a max age of 1 year, then for the next 30 days it would return the "stale" resource but revalidate in the background. On error, it would return the stale resource for 1 day. I'd like to consider extending that 1-day length to be longer as well... Maybe use 2592000 there too?
Would this be beneficial for PHP/HTML requests? I need to research what is considered an "error" state where the stale resource would be used...
Related: #1844
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Backend (Server)Related to the server-side (includes PHP, HTML, etc).Related to the server-side (includes PHP, HTML, etc).
