No Cache HTTP Headers


/ Published in: PHP
Save to your folder(s)

HTTP headers to disable caching.


Copy this code and paste it in your HTML
  1. header("Content-Type: application/json");
  2. header("Expires: 0");
  3. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  4. header("Cache-Control: no-store, no-cache, must-revalidate");
  5. header("Cache-Control: post-check=0, pre-check=0", false);
  6. header("Pragma: no-cache");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.