wpengine – bbird.me http://bbird.me WordPress quick tips Wed, 08 Aug 2018 16:39:07 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.8 Purging a stubborn WP Engine CSS cache http://bbird.me/purging-stubborn-wp-engine-css-cache/ http://bbird.me/purging-stubborn-wp-engine-css-cache/#comments Tue, 13 Sep 2016 18:25:36 +0000 http://bbird.me/?p=549 Here is the scenario – you created that awesome CSS and are dying to get it online. The client also.

Post Purging a stubborn WP Engine CSS cache je prvi puta viđen na bbird.me.

]]>
Here is the scenario – you created that awesome CSS and are dying to get it online. The client also. The website is hosted on WP Engine and is using its famous aggressive caching mechanism. You save the changes into style.css or elsewhere and clear the cache. But you still see the old style.css. You do it again and again and again and that old style.css is still there.

But I’ve got a quick trick for you – version your file! As you already know, the proper way to enqueue style or script in WordPress is the following:

wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( ), '1.0.0');

The number 1.0.0 is the style version which is not always included. If you want to make sure that after every cache purging the new version is loaded, you only have to change the version number. So if you put something like:

wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( ), '1.0.1');

after you have added new changes into style.css and if clear the cache after that, the new CSS version will be loaded immediately and a ton of your nerves (and your clients’ nerves) will be saved.

You’re welcome!

(yes, this happened to me, well, countless times…)

Post Purging a stubborn WP Engine CSS cache je prvi puta viđen na bbird.me.

]]>
http://bbird.me/purging-stubborn-wp-engine-css-cache/feed/ 2