Cache Busting for Theme CSS File
When the theme's scss file is edited and compiled, the version parameter on the stylesheet link in the HTML does not update. This means that browsers don't know to pull the updated css from the server if they have it cached, so the css updates won't apply for all users immediately due to browser caching. Here's an example of the line in the HTML with the version parameter:
<link type="text/css" rel=""https://yourlibrary.org/polaris/custom/themes/theme1/site.css?ver=7.1.14157.0">
It looks like the version parameter is based on the Polaris version, so I'm guessing it's automatically updated whenever Polaris is upgraded, but that doesn't help for theme adjustments in between upgrades. If this versioning parameter could be updated whenever the theme is compiled (and/or whenever the PAC is reloaded), that would be very helpful in terms of cache busting, to ensure that all users get the most up-to-date version of the theme.
This is especially important in cases where some HTML has been changed in conjunction with the CSS. It's common for browsers to pull a fresher version of the HTML but rely on cached CSS, and if a change has been made that requires both files to be updated, pairing the old cached CSS file with the new HTML can cause significant display issues.
-
Emma Olmstead-Rumsey commented
Yes, please! Since there are such a variety of devices, browsers, and settings, it's challenging to talk a patron through clearing their cache. And that only helps the small fraction of patrons who contact us--most patrons just continue to see the outdated information and we never even know.