Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119358

Jesse Gardner on "[Plugin: W3 Total Cache] Query String ID for Javascript/Stylesheet Caching"

$
0
0

For what it's worth, here's how I solved this.

First, I disabled the W3TC option to add query strings to the tail of JS/CSS files.

Then, I dropped the following code into my functions.php, specifically where I'm registering my main stylesheet and javascript files: https://gist.github.com/4282236

Nutshell: when registering m primary stylesheet and javascript, instead of passing a version number, I'm passing a CRC32-hashed string of the file. That way, when the size of the file changes (i.e. you make an update), so does this hash string.

Thus, browsers and proxies are forced to download the updated file, no matter the caching policy.


Viewing all articles
Browse latest Browse all 119358

Trending Articles