Why is my CSS not updating?

Category: TroubleShooting | Last modified: September 24, 2020

If you are not seeing changes that you have applied to your website, you may need to clear your browser cache and/or the CDN cache.

Browser Cache

Browsers can often cache files independently of directives from the server.

If you are adding/modifying in-line CSS or JavaScript and not seeing the changes reflected in the HTML source, the page is likely being cached. The solution may be to purge the WordPress object cache, which stores our page caching (Batcache) renders.

If you are adding/modifying CSS or JavaScript in files, the file itself may be cached. The solution may be to 1) ensure you are properly enqueuing CSS and JavaScript and 2) update the $ver parameter in the wp_enqueue_style() and wp_enqueue_script() functions.

Updating the $ver will force the browser to download the file anew and is a good mechanism to bust not only the browser cache, but the CDN cache as well.

CDN Cache

If the CDN is enabled, static assets will be cached. If you do not wish to bust the cache with parameters, you should be able to flush the CDN cache and achieve the same effect. (That said, it’s up to the browser to make the request in this case.)

An Automattic Invention A family of WordPress solutions.