httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Götz Lohmann <go...@mrblackrose.de>
Subject [users@httpd] {Spam?} Re: [users@httpd] Turn off cache
Date Mon, 15 Nov 2004 12:25:00 GMT
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 ?

Mime
View raw message