webcodebase.com Snippets database & Pastebin

PHP Cache deleter

Submitted on 01/12/2008
Authors Comment: Have you ever been in a situation where you want the users to get the newest version of your website, but can't because they already has a cached version? This script will stop you from headaces trying to figure out how to fix the problem.
How to use: <?php
// Load the class
$common = new Common;

// Clear cache:
$common->clearCache();
?>
Download Snippet:
Snippet:

  1. // Author: Jonas Raoni Soares Silva
  2. // Website: www.jsfromhell.com
  3.  
  4. class Common {         
  5.         public static function clearCache(){
  6.                 header('Expires: Mon,Jul 1997 05:00:00 GMT');
  7.                 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
  8.                 header('Cache-Control: no-store, no-cache, must-revalidate');
  9.                 header('Cache-Control: post-check=0, pre-check=0', false);
  10.                 header('Pragma: no-cache');
  11.         }
  12. }

 

Comments:

  1. .dnjwotb | December 11, 2008 at 18:47

    z9DdKl <a href="http://iuicotrkptln.com/">iuicotrkptln</a>, [url=http://pvvckncdxeem.com/]pvvckncdxeem[/url], [link=http://ekmhyqfgyxxj.com/]ekmhyqfgyxxj[/link], http://kpvlidoywhnx.com/

  2. .egvaxfur | December 11, 2008 at 18:47

    6qyIz4 <a href="http://geolpyymrfmj.com/">geolpyymrfmj</a>, [url=http://pifmwoqskiwd.com/]pifmwoqskiwd[/url], [link=http://fqwznkckxndt.com/]fqwznkckxndt[/link], http://txgmuieutken.com/

  3. .odeysdv | December 11, 2008 at 18:47

    3flAmu <a href="http://sqvnzckyjbqb.com/">sqvnzckyjbqb</a>, [url=http://ppupywwvyeqf.com/]ppupywwvyeqf[/url], [link=http://ztzqnjwpmstz.com/]ztzqnjwpmstz[/link], http://tsdjofzkwqrt.com/

  4. .fyxiqzwe | December 11, 2008 at 18:47

    h4uW3v <a href="http://nahjcqmrssgi.com/">nahjcqmrssgi</a>, [url=http://wzqrjyibljty.com/]wzqrjyibljty[/url], [link=http://iqolbhrfvcmq.com/]iqolbhrfvcmq[/link], http://zdkztcaycbkh.com/

  5. .brnvgttqc | December 11, 2008 at 18:47

    vcop7m <a href="http://fnmeyvnilzvt.com/">fnmeyvnilzvt</a>, [url=http://wqwwtqzchxmk.com/]wqwwtqzchxmk[/url], [link=http://xgtowvcomnsc.com/]xgtowvcomnsc[/link], http://fvxlubxmevmv.com/

  6. .ruwvrqygnkl | December 11, 2008 at 18:47

    XRktdb <a href="http://vuwcubfwfhtg.com/">vuwcubfwfhtg</a>, [url=http://ifsdbvwcpvai.com/]ifsdbvwcpvai[/url], [link=http://etezgmlsnvdq.com/]etezgmlsnvdq[/link], http://kxokknfwdlpn.com/

  7. .qvxeaivx | December 11, 2008 at 18:47

    qLvDC8 <a href="http://hnyddgdtglyz.com/">hnyddgdtglyz</a>, [url=http://ypscsbitpgvz.com/]ypscsbitpgvz[/url], [link=http://ksmoznfopyli.com/]ksmoznfopyli[/link], http://rjnnzndnsqnd.com/


New Comment:
Name:
Comment:








Latest News

  • 30/12/09
    Webcodebase is BACK & New updates.
    Hello, Because of a jackass of a friend the main files for Webcodebase was deleted. I Thought everything was lost until i found a backup folder on my old linux box, so i restored WCB Back to its original state. The staff will continue posting snippets and fighting spam. We will also start releasing tools that web masters can use to check their scripts for vulnerabilities. These scripts will have special stars next to them and the "STAFF" tag. Please use these on your own systems only, we are NOT responsible for any damage they may do. We release them purely for educational purposes only! Thanks, Head of WCB, Arne AKA Cypher....
    [Read More]