dub-registry
dub-registry copied to clipboard
Resources should be updated without having to manually clear browser cache
This can be solved by ex. changing:
<link rel="stylesheet" type="text/css" href="../styles/common.css"/>
to:
<link rel="stylesheet" type="text/css" href="../styles/common.css?v=1"/>
Then after modifications are done to common.css you simply change the query parameter.
That way the browser will always get the newest version of the stylesheet.
I've come across a few times where the pages hasn't displayed properly, because certain stylesheets etc. has been updated, but the browser has cached an older version.
This will resolve that. I'm sure I'm not the only one who has had that issue.
Perhaps an automated way to do it would be preferable, over having to do it manually.
the tabs didn't initially work because of this
Yeah, that's how I thought of this
Use content-based hashing instead styles/a7ea0dafed3fd83d1b8aa79601396c22e37f83a8-common.css
.
Although CRC-32 is definitely sufficient here, and even using the 32-bit Unix time stamp of the file (possibly combined with the file size) should be okay as a cheaper alternative.
It would also be interesting to test the actual performance impact of caching those files. With keep-alive connections and request pipelining, the ETag based cache management may end up more or less as fast as the time-based one