On Thu, May 25, 2000 at 11:00:01PM +1000, Andrew Shipton wrote:
> On Thu, 25 May 2000, Jeff Waugh wrote:
>
> > See if anyone has any ideas on the headers-for-images thing, otherwise you
> > might just have to hack in some temp filenames for the time being.
>
> MRTG (Multi Router Traffic Grapher) runs into this same problem. Their
> way of solving it was to write 'filename.meta' data out at the same time
> as the .gif image.
>
> This file contains a line like:
>
> Expires: Thu, 25 May 2000 23:00:31 GMT
>
> and with suitable mojo to the apache config, such as the following lines
> in access.conf:
>
> <Directory /usr/local/apache/share/htdocs/mrtg>
> MetaSuffix .meta
> </Directory>
I actually got it to work, but in a slightly different way.
first get rid of file:/// and use http://, apache doesn't
seem to generate [many] http headers when using file:///
and it won't work.
I think I'm starting to understand this stuff a bit better.
(my foggy understanding which might be totally wrong)
http is the transfer protocol, and that is the part that
needs to be adjusted to get caching to work properly. All
that img({-expires... stuff is in the html, which won't do a
thing for us. But the header(-expires... is http, so thats
good.
The browser makes two http requests, the first to
download the html generated by the perl script, we can
change the http header in perl with $q->header. The second
to download the gif, which apache generates the http header,
not the perl script.
The way I did it was.
in the <Directory /var/www> part of apache config add
ExpiresActive On
ExpiresByType image/gif A-999999
# roughly 12 days in the past, to be sure to be sure.
But I like the MRTG way better.
--
chesty
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text