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
major version pinning is not suitable for production - cache is too long with up to 14 days of cache #18532
Comments
Hey, have you tried the purge API? It should work well in this case: https://github.com/jsdelivr/jsdelivr#purge-cache |
hey @MartinKolarik, purging doesn't help since jsdelivr is also setting response max time headers of 7 days. hence, the browser will cache a link for 7 days in addition to jsdelivr caching 7 days. The worst case result is a close to 14 days cache. I updated the issue. The solution seems obvious. Reduce the caching time for version pinned modules to 12/24 hours. |
Quick note: the CDN cache time is only 12 hours already, as indicated by |
Good remark. In that case, the problem seems mostly jsdelivr purging-related. Lowering the JSDelivr cache time to 12 hours for major versions seems beneficial as we can't, and therefore jsdevlivr too, require developers to set up CI/CD to purge (too long) JS deliver caches. Would lowering the JSDelivr cache time from 7 days to 12 hours for major/minor versions be okay for JSDelivr? |
|
Edit
This seems like a bug rather than a feature request. The major version pinning caching times with 7 days, leading to worst case 14 days of cache are too long for a production use case. I updated the issue accordingly.
Is your feature request related to a problem? Please describe.
JSDelivr's caching is unsuited for major version pinning, where a module should update as soon as a new minor version is released.
We are recommending JSDelivr for inlang plugins. The fact that a JSDelivr link only updates after approximately 1 week due to JSDelivr's caching itself and the response headers leads to numerous bugfixes that are not immediately deployed. See opral/monorepo#1404 (comment) as an example.
In the worst case, it takes 14 days until a user receives the latest version.
Describe the solution you would like.
Reduce the cache time to a day or 12 hours like branches.
Describe alternatives you have considered.
Moving off of JSDelivr.
Requisites
The text was updated successfully, but these errors were encountered: