How to keep my pages from beein cached

Discussion in 'Programming/Scripts' started by dhonnoll78, Dec 19, 2007.

  1. dhonnoll78

    dhonnoll78 New Member

    My web pages for keep getting cached and for very long times. How do I code my pages to keep that from happening?
  2. volksman

    volksman New Member

  3. white.wizard

    white.wizard New Member

    From php manual about header function:

    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    // always modified
    header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache"); // HTTP/1.0

    This should do the trick.

Share This Page