CSS/JS Anti Cache doesn't appear to be correct
Submitted AutoItScript, Aug 09 2012 03:02 AM | Last updated Oct 15 2012 06:42 AM
In admin/sources/classes/output/publicOutput.php there is this code to generate an "antiCacheHash". This value is appended to the URL of minified JS and CSS so that when the JS/CSS is changed the client knows to make a new request so it doesn't get an outdated version. However, look at the code:
The hash value never likely changes except on a full IPB upgrade - it actually does nothing for helping with caching. When using minify on IPB the Expires header is set for 1 year, so until the antiCacheHash is working properly this causes some nasty problems with caching - especially on CDNs.
// Set a hash we can use to prevent client caching of CSS/JS $this->antiCacheHash = md5( IPB_VERSION . $this->settings['board_url'] . md5( $this->settings['sql_tbl_prefix'] . $this->settings['sql_pass'] ) );
The hash value never likely changes except on a full IPB upgrade - it actually does nothing for helping with caching. When using minify on IPB the Expires header is set for 1 year, so until the antiCacheHash is working properly this causes some nasty problems with caching - especially on CDNs.
| Status: | Fixed |
| Version: | 3.3.4 |
| Fixed In: | 3.4.0 |











4 Comments
Updating Status to: Fixed
I've added a unix timestamp of the time the skin was last updated into it.
Could you provide this as a patch (or just show which code needs to be modified to achieve this)?
We're currently experiencing problems with this on a CDN and would like to fix this before upgrading to 3.4.
Thanks in advance.