Re: FRAMES and CGI-scripts

Andrew Daviel (andrew@andrew.triumf.ca)
Fri, 6 Mar 1998 13:51:10 -0800 (PST)


Date: Fri, 6 Mar 1998 13:51:10 -0800 (PST)
From: Andrew Daviel <andrew@andrew.triumf.ca>
To: Sofie Johansson Kokkinakis <svesj@svenska.gu.se>
cc: www-html@w3.org
In-Reply-To: <Pine.HPP.3.91.980227104654.11336C@logos.svenska.gu.se>
Message-ID: <Pine.LNX.3.95.980306133901.18695B-100000@andrew.triumf.ca>
Subject: Re: FRAMES and CGI-scripts

On Fri, 27 Feb 1998, Sofie Johansson Kokkinakis wrote:

> Since I started using frames I seem to have a problem with "cache" memory.
> 
> When I activate a cgi-script from a form or a "<A HREF" link, I get no 
> new results, only the old results come up

In CGI you can generate explicit HTTP headers to control cacheing,
e.g. "Expires", "Cache-control", "Pragma", "Last-Modified". See the
HTTP/1.0, HTTP/1.1 spec.s for details

IMO one should try to generate as many headers as possible, i.e. valid 
Content-Length, Last-Modified, Expires with correct values, and if
feasible handle If-Modified-Since requests.

Setting "Pragma: no-cache" may (should?) result in the document not being
cached. Setting "Expires: 0" will probably result in the document being
cached, but an If-Modified-Since request being sent every time. Setting
a valid GMT expiration time will result in the cached copy being used
(depending on browser preferences) until the expiry date is passed, when 
an If-Modified-Since request will be sent (based on the Last-Modified
date).

If desperate, adding a junk query to the URL will guarantee a new
document. (One should add Expires: 0 to prevent hierarchical cache wasting
resources saving junk URLs)

Andrew Daviel
TRIUMF & Vancouver Webpages
http://vancouver-webpages.com/CacheNow/ - campaign for proxy cache