in reply to Trouble Caching an Image

Is there any reason you can't just replace the whole thing with:
print "Location: /internal/web-path/to/shut.jpg\n\n";
possibly regenerating shut.jpg if it's too much out of date?

Then you get the if-modified-since logic for free, as well as the chunking and mod-time printing.

Internal redirects can be very cool, and are far too much underutilized. CGI is not the only interface. {grin}

-- Randal L. Schwartz, Perl hacker