How To Avoid Wordpress Theme CSS Cache

When developing WordPress powered website for my clients (mostly in remote sites), I have to make sure that they always get  the latest version of updated WordPress theme. Proxy server sometimes gives problem that is due to its cache on CSS files.

There are several alternative to solve this problem. Bypassing proxy server can be tricky but will not work if client is behind transparent proxy. Mark Jaquith did the following code and added it to the header.php

<link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/style.css?v=<?php echo filemtime(TEMPLATEPATH . ‘/style.css’); ?>” type=”text/css” media=”screen, projection” />

If you prefer to use a plugin,  CSS Cache Buster is available to save your days.

You can leave a response, or trackback from your own site.

2 Responses to “How To Avoid Wordpress Theme CSS Cache”

  1. [...] This post was mentioned on Twitter by WPNomics. WPNomics said: How To Avoid Wordpress Theme CSS Cache http://digs.by/1nIb [...]

  2. PJ says:

    Neither that code or Cache Buster solves the problem for me, when people who have never visited the site before enters it looks like crap, they have to refresh the window one extra time and then it looks as its supposed to. Extremely annoying. The only solution that works for me is to put all the style directly in the tag. :(

Leave a Reply

You must be logged in to post a comment.

Powered by WordPress | diSolo.BIZ | diSolo.COM