Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stale-if-errror in Cache Control when available [🟥 awaiting full support] #2291

Open
chrisblakley opened this issue Aug 21, 2024 · 0 comments
Labels
Backend (Server) Related to the server-side (includes PHP, HTML, etc).
Milestone

Comments

@chrisblakley
Copy link
Owner

https://caniuse.com/mdn-http_headers_cache-control_stale-if-error

Screenshot 2024-08-21 at 11 06 22 AM

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

@chrisblakley chrisblakley added the Backend (Server) Related to the server-side (includes PHP, HTML, etc). label Aug 21, 2024
@chrisblakley chrisblakley added this to the 13.0 Bubble milestone Aug 21, 2024
@chrisblakley chrisblakley changed the title Use stale-if-errror in Cache Control when available (🟥 awaiting full support) Use stale-if-errror in Cache Control when available [🟥 awaiting full support] Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend (Server) Related to the server-side (includes PHP, HTML, etc).
Projects
None yet
Development

No branches or pull requests

1 participant