[Zope-CMF] I do not want to press the reload-button

Tres Seaver tseaver@palladion.com
Mon, 1 Oct 2001 05:45:04 -0400 (EDT)


On 1 Oct 2001, Jan Ulrich Hasecke wrote:

> Hi,
> 
> I have a problem.
> 
> When I edit content in my CMF and view it, my browser caches the old
> page, so that I have to press the reload button to see the changes.
> 
> This disturbs new users I think.
> 
> Is it the right way to prevent browsers to cache pages, when I insert this
> 
> <meta http-equiv="pragma" content="no-cache">
> 
> in standard_html_header?

The better place for this is in the HTTP cache headers:

  <dtml-call expr="REQUEST['RESPONSE'].setHeader('Cache-control'
                                                ,'must-revalidate')">

This header will force the user's browser to do a "conditional GET",
passing "If-modified-since", before redisplaying (this is what the
reload button does now).

> Or do you know better solutions. AFAIK no-cache is a command for
> proxies not for browsers.

HTTP's Cache-control applies to the browser's cache, as well.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com