Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Force browser to refresh css, javascript, etc
  2. header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
  3. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  4. header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
  5. header("Cache-Control: post-check=0, pre-check=0", false);
  6. header("Pragma: no-cache");
  7.        
  8. <script src="foo.js<?php echo '?'.mt_rand(); ?>" ></script>
  9. <link rel="stylesheet" type="text/css" href="foo.css<?php echo '?'.mt_rand(); ?>" />
  10. <img src="foo.png<?php echo '?'.mt_rand(); ?>" />