Hi,

I was thinking of writing yet-another-photo-album-server, and I 
had the idea that I'd write a handler to serve resized versions 
of JPEGs (very original, I know ;-).  The idea is that I'd put a 
bunch of JPEGs on the server at locations like foo/123.jpg , and 
then if a request came for foo/123-medium.jpg , I'd catch that 
with a 404 ErrorDocument and generate the resized image using 
Imager.  If I wanted to, I could also create the resized image 
on disk, so it wouldn't need to be generated next time.

Some questions arise, however.  I've got it working by setting 
$r->content_type("image/jpeg") in the 404 subrequest.  Should I 
also be setting $r->prev->content_type ?  Same question for 
$r->status and $r->prev->status.  It seems to be "working" 
either way, but I don't know what the proper thing to do is.

The idea is that I'm not just trying to give the user a friendly 
404 error message, I'm trying to fool the user into thinking the 
requested document really does exist.  I've done this a lot with 
<Location> and so on, but I don't think I've ever tried it with 
an ErrorDocument, so I'm interested in feedback.

  -Ken

Reply via email to