You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Götz Lohmann <go...@mrblackrose.de> on 2004/11/15 13:25:00 UTC

[users@httpd] {Spam?} Re: [users@httpd] Turn off cache

Ralf Glauberman schrieb:

> don't know what kind off caching you mean, but you can modify the 
> headers to prevent browsers/proxies from caching....
> Ralf

One way is to use the apache modul mod_header in a .htaccess or in 
httpd.conf like

   Header append Pragma "no-cache"
   Header append Cache-Control "no-store,  no-cache, must-revalidate"
   Header add Cache-Control "post-check=0, pre-check=0"

.. in PHP you could do that as described below like:

<?php
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");              // Date which is gone
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always changed
  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
?>

or do you mean the CacheNegotiatedDocs Directive in httpd.conf ?