0
votes

I am modifying a WordPress site's appearance (minor modifications) but can't see the result on chrome because of annoying persistent cache. I tried shift+refresh but it doesn't work. how can i disable the cache temporarily or refresh the page in some way that I could see the changes?

thanks.

2

2 Answers

2
votes

You should not modify your code to achieve this. If you are using Google Chrome as you said you should press Ctrl+Shift+j and go to Network tab. Check the Disable cache option and reload the page. Browser will display the response from the server (not from cache).

0
votes

You can delete the browser cache by adding these headers in your header.php file :

<?php
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

Hope this will help you.

Regrads