2020-12-24
Getting caching right is still very hard
After switching my websites to https I found out caching works differently on https (for good reasons) and files included by lots of pages got reloaded a lot. So I added some caching hints. I especially did not want the stylesheet to be reloaded constantly. So I added an ExpiresByType directive to cache stylesheets for a week. But on the change of camp-wireless to a new stylesheet and programming language I got bitten by this: some browsers had the old css code cached and saw no reason to check for updates. The site looked strange (but wasn't really broken). I recently made some changes to parts of my homepage too, also going to the CSS grid model, just like the changes in Camp Wireless to the CSS grid model. And I had the same problems with the CSS in the production version. It took a bit of searching to find the source of the Expires statement, it was in the .htaccess file. Now fixed to a much shorter cache time, it is quite possible to have versions of the pagecode and CSS differ in the browser.