On Sun, 27 Oct 2002, [ISO-8859-1] Crist�v�o Dalla Costa wrote:
> Geoffrey Young wrote:
>
> > Kyle Oppenheim wrote:
> > > $R->content_type ($data {mimetype});
> > > $R->set_content_length ($data {size});
> > > $R->header_out ('ETag',$data {md5});
> >
> > don't do that. use the $r->set_etag method instead, which is probably a
> > bit safer than trying to figure out Etag rules yourself. I'm pretty
> > sure that you shouldn't use the Etag header with non-static entities
> > anyway, but I could be wrong.
>
> Why not? I'm sending images stored in a database.
You may want to take a look at
http://perl.apache.org/docs/general/correct_headers/correct_headers.html
where, like Geoff suggested, it is strongly advised to
*not* use set_etag() for dynamic content. This page also
discusses the Last-Modified, Expires, and Cache-Control headers.
> $r->set_etag doesn't seem to work, it wants to be called as
> Apache::set_etag ()
>
> [Sun Oct 27 14:37:39 2002] [error] Usage: Apache::set_etag(r) at...
This usage message I think is coming from the C side, giving how
the correspoding C function would be called. The error may be
coming from trying to set this for something other than a file on
disc.
> > > $R->update_mtime($data {mtime});
> > > $R->set_last_modified;
>
> Another thing, what sort of data should I pass to update_mtime? It
> complains:
>
> Argument "2002-10-25 19:41:14.046993" isn't numeric in entersub at...
>
> Why can't I find these methods in the Apache and Apache::Request
> manpages? Should I be looking elsewhere?
Try the Apache::File manpage, which also gives some examples
of the usage. You may also want to look at the parsedate()
and ht_time() functions of Apache::Util.
--
best regards,
randy kobes