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 versioned subresource URLs with far-future max-age #177

Open
dfabulich opened this issue Jan 23, 2025 · 1 comment
Open

Use versioned subresource URLs with far-future max-age #177

dfabulich opened this issue Jan 23, 2025 · 1 comment

Comments

@dfabulich
Copy link
Contributor

dfabulich commented Jan 23, 2025

Due to #176, the runtime size of https://iplayif.com/?story=https%3A%2F%2Fifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8 has increased considerably, so it's more important that we get the caching rules exactly right, like in iftechfoundation/ifarchive-unbox#68

The page loads subresources like https://iplayif.com/dist/web/bocfel.wasm with an unversioned URL, and it's set to Cache-Control: max-age=600, five minutes.

Instead, we should refer to subresources as bocfel.wasm?lastmod=#### and they should return a far-future max-age=31536000, one year

  • jquery.min.js
  • web.js
  • web.css
  • iosevka-extended.woff2
  • iosevka-extendedbold.woff2
  • bocfel.js
  • bocfel.wasm
@curiousdannii
Copy link
Owner

I'm on board with this. For the files in dist/ I'm currently just telling nginx to proxy them to the Github CDN. It would be great if I can detect the lastmod query within nginx and set the max-age, but if necessary we could shift it to the Node app instead.

dfabulich added a commit to dfabulich/asyncglk that referenced this issue Jan 23, 2025
dfabulich added a commit to dfabulich/parchment that referenced this issue Jan 23, 2025
dfabulich added a commit to dfabulich/asyncglk that referenced this issue Jan 23, 2025
dfabulich added a commit to dfabulich/parchment that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants