Open robertknight opened 8 years ago
Status update for May 2023: The code for serving static assets was extracted into the h-assets package. That still uses query strings as cache busters, but it does validate them and return a 404 if the cache buster query string is invalid.
This resolves the first problem where Sentry could end up receiving a bug report for version X and end up fetching the static asset for a later release Y.
However this problem is still open:
Sourcemap URLs do not include cache-busting tokens
The challenge here is that the sourcemap URL is part of the JS / CSS bundle generated by Rollup or PostCSS respectively.
Note: This issue was originally filed against the h project, before we extracted the h-assets package and started using it across different projects.
Current issues with static assets and cache busting
Not all resources are served with cache-busting tokens in the URL. eg. SVG images are currently served without. This may lead to users seeing old versions of assets.FixedProposed changes
Fix manifest.json generation in client and server to include all assets (see https://github.com/hypothesis/h/pull/4106#issuecomment-262760621)Fix image asset serving to include cache-busting tokens (see https://github.com/hypothesis/h/pull/4106#issuecomment-262760621)cache_max_age
parameter in thestatic_view
to a large value so that clients do not re-download assets that they already have.