-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Upon publishing an update to the state of private voting report 2026, the pdf on the production website would not update to the latest version. This was because of the caching policy we have set for static resources. Which is currently set to immutable and it refreshes after 1 year.
In order to fix this, we had to change the versioning of the url, as suggested by the mozilla docs. The mozilla docs recommend the following for immutable resources (scroll down to immutable section):
A modern best practice for static resources is to include version/hashes in their URLs, while never modifying the resources — but instead, when necessary, updating the resources with newer versions that have new version-numbers/hashes, so that their URLs are different. That's called the cache-busting pattern.
It took us a few iterations to figure this out: #604 #605 #606
This issue is concerned with revisting the caching policy to decide if it is too aggressive. The resolution to this issue could be that the caching policy is fine, and the correct solution is to follow the "cache-busting pattern" of changing urls. Or it could be to relax the caching policy to avoid issues updating static resources.