Frontend caching - Enterprise-CMCS/cmcs-eregulations GitHub Wiki
History
In March 2022, we implemented a simple caching mechanism because sidebar content took a long time to load - we were making a lot of calls to get the information, and it took a while to serialize the data. We had this cache configured to 8 hours, so that people only got a slow experience the first time they loaded a subpart each day.
In June 2024, we turned off caching to minimize confusion for team SMEs and staff editing content. It was helpful to them to be able to see their changes on the site right away. We had improved our efficiency in other ways, so the cache wasn't necessary anymore.
In February 2025, we removed this functionality. If we need caching again someday, we could use a more standard method, such as Redis, instead of this custom solution.
Retired functionality
When you view a regulation page on eRegulations, the website "caches" certain bits of data for that page - in other words, it saves a copy of the data in a tiny file on your computer (as part of a hidden browser storage folder). That tiny cache file expires (gets automatically deleted) at a configurable time, so people should see fresh data periodically.
Pros:
- If you view a page and then refresh it or load it again in a little while, resources load instantly. This is intended to be a good experience for users doing research, especially anyone on a slower internet connection.
Cons:
- When a SME views a regulation page, then tags a resource intended to show up in the sidebar for that page, and then views the page again a minute later, it'll show the old version from the cache.
- A user doing research may not see brand-new links until their next work day.
Configuration
The devs can adjust the length of time for caching or turn it off.
How to bypass the cache
- You can open an incognito window to see new material: Ctrl-Shift-N (Windows) or Command-Shift-N (mac OS) in Chrome or Edge.
- You can go to our cache-clearing tool (add
/cache/to the end of our URL, like this:https://example.com/cache/), scroll to the end, and choose "delete all cache items".