Re: Caching of cgi results

In a previous episode...Andy Coles - WEB developer said:
-> 
-> Is there a simple method to stop browser cacheing the results of a cgi request. For instance, I have a cgi which writes out a gif on the fly and although the URL to this cgi looks the same every time:-
-> 
-> i.e.
-> 
-> <IMG SRC="/cgi-bin/image?block.gif">
-> 
-> the image produced is actually different. The browser caches the first image and will only show the latest version if you reload the page.
-> 

Please consider if you really don't want that gif to be cached at all,
that can really waste bandwidth. If it is just something that
periodically changes then set 1/2hr or 1/2day expires limits.. here's
the syntax.

From http://www.w3.org/pub/WWW/Protocols/HTTP/1.0/spec.html.gz

10.7 Expires

The Expires entity-header field gives the date/time after which the
entity should be considered stale. This allows information providers
to suggest the volatility of the resource, or a date after which the
information may no longer be valid. Applications must not cache this
entity beyond the date given. The presence of an Expires field does
not imply that the original resource will change or cease to exist at,
before, or after that time. However, information providers that know
or even suspect that a resource will change by a certain date should
include an Expires header with that date. The format is an absolute
date and time as defined by HTTP-date in Section 3.3.

       Expires        = "Expires" ":" HTTP-date

An example of its use is 

       Expires: Thu, 01 Dec 1994 16:00:00 GMT

If the date given is equal to or earlier than the value of the Date
header, the recipient must not cache the enclosed entity. If a
resource is dynamic by nature, as is the case with many data-producing
processes, entities from that resource should be given an appropriate
Expires value which reflects that dynamism.

Received on Friday, 31 May 1996 08:51:37 UTC