0
  <meta http-equiv='cache-control' content='no-cache'>
  <meta http-equiv='expires' content='0'>
  <meta http-equiv='pragma' content='no-cache'>


  <?php
  function clearBrowserCache() {
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  
  header ("Cache-Control: no-cache, must-revalidate");  
  header ("Pragma: no-cache");
  }
  clearBrowserCache();

  $_SESSION['test']="demo";
  //echo $_SESSION['test'];
 clearstatcache() ;
 ?>
  • this code is only allowing browser to not to catch cache .but i want to delete all cache using simple code is there any way to do it ? simply i when i run this code my browser's cache should get deleted. how to do it ?
braX
  • 11,506
  • 5
  • 20
  • 33
Bhu
  • 27
  • 1
  • 10
  • however you can't clear client browser cache – JYoThI May 31 '17 at 07:05
  • @JYoThI so there is no way ? we can clear catch using some code. – Bhu May 31 '17 at 07:08
  • 1
    Possible duplicate of [cant clear cache from my browser in php](https://stackoverflow.com/questions/44261575/cant-clear-cache-from-my-browser-in-php) – Milan Chheda May 31 '17 at 07:38
  • You had asked this same question yesterday too (https://stackoverflow.com/questions/44261575/cant-clear-cache-from-my-browser-in-php AND https://stackoverflow.com/questions/44262143/cache-clear-is-not-working-in-php). You need to close/delete them and keep only one open. DO NOT ASK same question again and again. Kindly delete/close them. – Milan Chheda May 31 '17 at 07:38
  • @Milan chhedadidnt get the proper answer for this question sure i will delete it – Bhu May 31 '17 at 07:45
  • If you didn't get the answer, you can rephrase or add bounty but don't create add same question again. Thanks. – Milan Chheda May 31 '17 at 07:50
  • @Milan chheda sure next time i will keep this in my mind :) – Bhu May 31 '17 at 07:52
  • Possible duplicate of [How to clear browser cache with php?](https://stackoverflow.com/questions/1037249/how-to-clear-browser-cache-with-php) – Addison May 31 '17 at 08:13

0 Answers0