SPUG:CGI header question

Peter Darley pdarley at kinesis-cem.com
Thu Jun 19 12:47:52 CDT 2003


Brian,
	In this case the CGI script takes almost no CPU and well under a second of
real time to execute, but then I'm sending out close to a meg of data over
my crappy 128K up DSL, so not having to send the image again would be a
significant win.
Thanks,
Peter Darley

-----Original Message-----
From: Brian Hatch [mailto:spug at ifokr.org]
Sent: Thursday, June 19, 2003 10:07 AM
To: Simon Wilcox
Cc: Peter Darley; SPUG
Subject: Re: SPUG:CGI header question




> Have a look at the headers the browsers are sending with their request.
>
> There should be one named If-Modified-Since. You can compare this date
> with the modified date of your image and return a 304 (Not Modified)
> status code instead of 200. This will cause the browser to use the
> cached image.
>
> Normally this happens automatically for images in the filesystem but you
> have to hand code it into CGI apps.

Of course, this still requires that the CGI is being run, and that it
queries the database to check the image timestamp.  It's less overhead
than actually grabbing and returning the image, but the browser still
needs to query the image each time, and the CGI must run each time.


--
Brian Hatch                  To strive, to seek, to find,
   Systems and               and not to yield.
   Security Engineer
http://www.ifokr.org/bri/

Every message PGP signed




More information about the spug-list mailing list