Can't purge Stylesheets on EE with Ubuntu 14.04 x64

May 13, 2015 889 views
Nginx Caching Ubuntu

Hello Digital Ocean community!

I'm running a Wordpress website with EE (nginx fastcgi_cache) and for the last couple of months everything was working fine but it seems after i started to create new websites i've found an issue that prevent me from purging/refreshing my stylesheets.

The server is running versioned css files ".css?ver=4.2.2", and it seems this is the problem because if i check the file without the versioning numbers i can see the changes. At first i thought it was something to do with the template but it happens with all of them and i've also tested this issue on 3 different servers running EE.

I can purge my changes using "ee clean --all" but this is getting anoying because i'm a theme developer and i need constant updates on the stylesheets.

Any idea on where to look for a solution? I've also debug nginx and reloaded the configus but no issue found.

2 Answers

You can disable the cache only for IE with the following directive:

if ($http_user_agent ~ MSIE ) {
# Or a specific version
# if ($http_user_agent ~* '(MSIE 8.0|MSIE 7.0)') {
  set $is_ie true;

proxy_no_cache $is_ie;

Read more about the fastcgi_no_cache directive here.

I encourage you to debugg your cache as described in this article about nginx caching. It can help you find out if your caching works how you want it. Remember to first debugg your server with curl and then if everything works with IE. Don't trust any browser ;-)

Thank you for pointing me into the right direction.
I'll post feedback later.

Have another answer? Share your knowledge.