putting Image from database in cgi app

Gerhard Häring gh at ghaering.de
Wed May 21 11:19:58 EDT 2003


Fredrik Lundh wrote:
> Gerhard Häring wrote:
> 
> 
>>>>In the end, using the temp file is probably the easiest solution, at
>>>>least as long as the web technology you use is CGI.
>>>
>>>and you never have more than one visitor at a time, or don't care
>>>if people don't get the right cover...
>>
>>How would that be a problem? Just create a unique name for the temp
>>file, put in a directory, like, say "cache/" and have a cron job that
>>periodically deletes old temp files.
> 
> 
> uhuh.  so now you have to invent a naming scheme, make sure you
> have enough diskspace to hold cached data for an unknown number
> of customers, make sure your cron job works as expected (if it stops,
> you may fill the disk; if it removes everything every time it runs, your
> customers can still end up with broken images) -- and even if every-
> thing works as planned, your customers may still end up with broken
> images, since you cannot guarantee that a client browser will always
> refetch the original page before the image when the user moves
> around in the browser history.
> 
> how exactly is this easier than writing a 10-line CGI script that does
> the right thing?

Point taken.

It wouldn't have used such an approach anyway.

-- Gerhard





More information about the Python-list mailing list