How can I clear all my websites cache without using a plugin? Is this possible? If so then how can I do it?

Thanks

closed as unclear what you're asking by Pieter Goosen, fuxia Oct 17 '15 at 7:42

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    hmmmm what cache? – Mark Kaplun Oct 17 '15 at 5:31
up vote 1 down vote accepted

If this is about .css and .js changes, one way is to add "versions" of your files. For example:

script_1.0.css // This is the URL for release 1.0
script_1.1.css // This is the URL for release 1.1
script_1.2.css // etc.

Or alternatively do it after the file name:

script.css?v=1.0 // This is the URL for release 1.0
script.css?v=1.1 // This is the URL for release 1.1
script.css?v=1.2 // etc.

In wordpress you have option for versions of included JS files in wp_enqueue_script() in PHP:

/*EXAMPLE*/
wp_enqueue_script("yourscript", "joursctipt.min.js",array(),'3.3.5',true);

Here is DOCUMENTATION!

Also you can do that in CSS but manualy in URL:

wp_enqueue_style( 'toalc', get_template_directory_uri().'/style.css?v=1.0.5');

When you change something in your CSS or JS, just change version of your file and cache will be deleted.

If is cache of your images then you have one trick:

<img src="image.jpg?v=1">

or using PHP random string for each image to clear cache on each refresh:

<img src="image.jpg?v=<?=mt_rand(1000,9999); ?>">

Text and other forms is not stored in cache, autocomplete forms you can prevent with:

<input autocomplete="off">

NOTE: autocomplete is supported only for few browsers.

Not the answer you're looking for? Browse other questions tagged or ask your own question.