I updated the style.css file of my WordPress installation recently. The change were effective: when logged in as an administrator (my blog is set so that the administrator is never served a cached version of the site, but a “live” one), I can see them.

But my blog is being served through a CDN (using W3 Total Cache). Through the CDN, the changes are not effective: the CDN does not serve the modified files from my theme. Even though I’ve uploaded them after modification (Dashboard>Performance>CDN>Upload theme files.

My CDN runs on AmazonCloud Front. And Minify is disabled on W3 Total Cache.

The theme file being served through my CDN is a compressed version: style.css.gzip

Should I “purge” objects from my CDN or wait a little more (it’s been more than a week). And yes, I empty the cache of the browser I’m using to see in the changes are taking effect. Or is there something else I’m missing?

Thanks,

P.

3 s
3

You need to either

  1. Version your files (by calling it style.css?ver=xxx.xxx) and making sure your CloudFront distribution has “Forward Query strings” turned on. This is the better option, as it means that all you need to do is increment the number in the query string and CloudFront will fetch this file automatically.

  2. Manually invalidate your files via the AWS Console (there is an invalidation tab when you edit your distribution)

To turn on ‘Forward Query Strings’ do the following:

  • Edit your Cloudfront distro by ticking the checkbox on the left of the ‘i’ and then click on the “distribution settings” button in the toolbar
  • Go to the Behaviors tab
  • Select the line, and click on ‘Edit’
  • Change “forward query strings” to Yes
  • Click on “Yes, Edit”

Leave a Reply

Your email address will not be published. Required fields are marked *