Comments on: How to Prevent Browser Caching of a CSS Stylesheet in WordPress https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/ A hub for advanced WordPress users, developers & savvy business owners. Mon, 20 Feb 2023 21:13:28 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: igre https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21323 Mon, 20 Feb 2023 21:13:28 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21323 tnx for info …

]]>
By: Spephen https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21322 Wed, 25 Nov 2020 04:04:25 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21322 It’s helpful. Thanks so much

]]>
By: Ana https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21321 Sat, 11 Apr 2020 13:57:02 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21321 Thanks Fred! It helps me a lot!

]]>
By: Someone https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21320 Fri, 21 Jun 2019 03:44:39 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21320 Awesome!!!

]]>
By: mark aaron https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21319 Mon, 10 Jun 2019 02:04:56 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21319 Clever trick. Works great 🙂

]]>
By: Aamer Shahzad https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21317 Tue, 08 Jan 2019 12:01:41 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21317 Every time when you change file version it will never get cached and performance will not improve if you apply cdn on that file. I had same issue. I generated a unique string with time when last time file was updated with filemtime() php function. now when I update the file the new version is cached. here is the code.

$css_update_time = filemtime( get_stylesheet_directory() . ‘/style.css’ );
wp_enqueue_style( ‘main-style’, get_stylesheet_uri(), null, $css_update_time );

]]>
By: kate https://wpshout.com/prevent-browser-caching-css-stylesheet-wordpress/#comment-21315 Thu, 07 Sep 2017 14:04:38 +0000 https://wpshout.com/?post_type=quick_guide&p=10841#comment-21315 This is really helpful – can we put versioning via WordPress on the home page too?

]]>