List Info

Thread: About modules/metadata/mod_expires.c (apache 2.2)




About modules/metadata/mod_expires.c (apache 2.2)
user name
2007-08-26 09:33:37
Hello everybody,

While setting up a reverse proxy squid + apache w/ mod_expires.c in order to decrease the load on the web server, I discovered that mod_expires.c was working by checking the mimetype of the content generated by the web server ( i.e. cgi or static file) and not the mimetype of the file that was used to generat the output. Could someone explain me why it is so ?

For me, it would make more sense to be able to differentiate  what was generated by executing a CGI script and what was generated by reading a static file, especially in caching context like it is the case here. Indeed, I don't think you want to give the same expiration date to a static file (unlikely to change every hour) to a content generated by, let's say, a php script that is using a database (more likely to change every minute).

The problem (im my opinion) is that Apache cannot differentiate between those 2 types of stream and, therefore, setting up the cache expiration time for text/html is working both for static files and for cgi scripts outputing text/html content.

Is there any plan to change the behavior of mod_expires.c to differentiate between those 2 kinds of data stream before setting the Expires: field of header ?

Maybe I'm completely wrong in my observation or there is a part of the big picture I didn't see, any explanation welcome

Thanks

Julien, beginner in modules development

Re: About modules/metadata/mod_expires.c (apache 2.2)
user name
2007-08-26 13:48:57
On 8/26/07, Julien Perez <julien.perezepsylonia.net> wrote:
> Hello everybody,
>
> While setting up a reverse proxy squid + apache w/
mod_expires.c in order to
> decrease the load on the web server, I discovered that
mod_expires.c was
> working by checking the mimetype of the content
generated by the web server
> ( i.e. cgi or static file) and not the mimetype of the
file that was used to
> generat the output. Could someone explain me why it is
so ?

I believe that is exactly what most people expect and want.
For
example, people want different expiration times for html
versus gif
versus css. Many people would be annoyed if html generated
by cgi was
not matched.

For what you want, you can use ExpiresDefault scoped in a
<Directory>
or <Files> section to apply only to the specific
content that you
need.

Joshua.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )