简体   繁体   中英

How to clear the Wordpress cache?

My website is loading style.css?ver=1.0. style.css?ver=1.0 had different content to style.css?ver=1.1 or style.css, even after a hard refresh of style.css?ver=1.0.

Deleting the browser cache didn't fix my problem.

Loading style.css?ver=1.0 in a different browser did.

After clearing the cache upto 10 to 12 times. The style.css will be ok. I want to get rid out of this method. And also css is minified. My CSS is not minified. I install the plugin BWP-minify and i deleted it after the problem started.

During development, you could avoid the hassle of clearing the browser cache by passing a dynamic variable as the stylesheet's version when you enqueue it. For instance, the current time.

wp_enqueue_style( 'theme-style', 'style.css', array(), date("h:i:s") );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM