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

Set max-age=0 for all resources, except those with lastmod parameter #65

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dfabulich
Copy link
Contributor

Fixes #64.

Setting max-age=0 ensures that we'll always return fresh HTML content.

This won't blow out our bandwidth, because browsers/nginx/Cloudflare will still do conditional GET requests, which we'll respond with a cheap, fast "304 Not Modified" response in most cases.

For subresources on on the subdomain, we already redirect them to the main domain, but now, we redirect them with a ?lastmod=### parameter. URLs with that parameter can have a week-long max-age, because if they change, we'll switch to a different URL.

@dfabulich dfabulich force-pushed the cache-busting branch 2 times, most recently from 7f0fe4a to 2141690 Compare September 6, 2024 00:13
Fixes iftechfoundation#64.

Setting max-age=0 ensures that we'll always return fresh HTML content.

This won't blow out our bandwidth, because browsers/nginx/Cloudflare will still do conditional `GET` requests, which we'll respond with a cheap, fast "304 Not Modified" response in most cases.

For subresources on on the subdomain, we already redirect them to the main domain, but now, we redirect them with a `?lastmod=###` parameter. URLs with that parameter can have a week-long max-age, because if they change, we'll switch to a different URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unboxer has an unbustable cache, which can take weeks to clear out
1 participant