Mobile app version of vmapp.org
Login or Join
Cooney921

: Change CSS and JS Files - Force Website not loading from browser cache When i change the css and js files in my wordpress templates and visit my website, the website is still loading the

@Cooney921

Posted in: #Cache

When i change the css and js files in my wordpress templates and visit my website, the website is still loading the old css and js files from the browser cache. How can i tell the website that if my cache is older than a specific date, it should load the new template files?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

2 Comments

Sorted by latest first Latest Oldest Best

 

@Annie201

You can disable any cache plugin used in the website .
Clear your browser cache
Add expiration tag for css and javascript files in.htaccess file

10% popularity Vote Up Vote Down


 

@Annie201

If you're using a cache plugin on your WordPress platform, you should clear the plugin's cache, so it clears and caches a new version of these files. (there should be an option to set an expiring date to it also, depending on the plugin.)


Else...

You can use query strings in order to force the browser's new file update.

Query string example: ?v=2045

Here's an example on a <link> tag:

<link rel="stylesheet" type="text/css" href="theme.css?v=1">





If you wish for this file to be updated only on your side, you can do a CTRL+F5 browser refresh, and a new cache request will be made.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme