HTTP cache age for studio game server files
Posted: 05 July 2020, 15:56
I recently did a redesign of the UI on my game, which involved extensive changes to the CSS. I playtested the game with friends before and after these changes. Some of the testers reported incorrectly rendered game displays, which was eventually tracked down to the fact that their browsers were using old cached versions of the CSS. This was seen on browsers running on different OSes, and of different browser families (mainly Mozilla/Firefox and Chrome).
In tracking this down, I noticed that the studio game server returns the following response header with the CSS file:
Cache-Control: max-age=2592000
This is a cache expiry of one month; the playtests were about 10 days apart. There is a valid concern that the browsers were not noticing that the CSS file was updated, but I am suspicious because the problem crossed browser families. I am wondering if having a cache age of one month is appropriate for materials served by the development server, where change is more frequent than in production. This would especially be the case for non-media files like the CSS and PHP files. In my opinion, a cache age of 3-5 days would probably be more appropriate.
In tracking this down, I noticed that the studio game server returns the following response header with the CSS file:
Cache-Control: max-age=2592000
This is a cache expiry of one month; the playtests were about 10 days apart. There is a valid concern that the browsers were not noticing that the CSS file was updated, but I am suspicious because the problem crossed browser families. I am wondering if having a cache age of one month is appropriate for materials served by the development server, where change is more frequent than in production. This would especially be the case for non-media files like the CSS and PHP files. In my opinion, a cache age of 3-5 days would probably be more appropriate.