iftechfoundation / ifarchive-unbox

IF Archive Unboxing service
https://unbox.ifarchive.org
MIT License
1 stars 2 forks source link

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

Open dfabulich opened 1 month ago

dfabulich commented 1 month ago

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.