On Mon, 2007-03-26 at 10:14 -0600, Joe Lewis wrote: > > Sam Carleton wrote: > > > >> On 3/26/07, Issac Goldstand <[EMAIL PROTECTED]> wrote: > >> > >>> If the images are already on the server, and needed for the response > >>> immediately, you'd need to do it inline, but you could still make life > >>> easier on yourself (somewhat) by caching the reduced images to avoid > >>> reprocessing. > >>> > >>> I could give more specific advice if you could share a bit more about > >>> what you're trying to accomplish in general. > Another alternative is to cause the image links to point to a directory, > and use > > ErrorDocument 404 /cgi-bin/script-to-generate-thumbnails.pl >
No -- please don't do that. You are terribly abusing the protocol. An "Error Document" is just this - an indication of what went wrong. The client will still receive a 404 status, and, expecting an _image_, just display the dreaded broken image icon ... Iff you want to go this road you must redirect to a handler that can modify the status. BTW, with HTTP/1.1 and chunked encoding there shouldn't be any problem generating the image on the fly and then storing it in the cache. And there _are_ response status that indicate a lengthy content generation ... HTH Ralf Mattes > Which CGI generates the image and dumps it to the browser as well as > storing it. Then, each subsequent image request comes from the static > file. If you need them to be cleaned up once in a while and > regenerated, just create a cron job with "find" to locate the "old" > thumbnails and delete them, which causes the 404 and regenerates the images. > > Joe
