Bart van der Schans a écrit :
Matthieu Estrade wrote:
Colm MacCarthaigh a écrit :
I agree on this point, but people using this directive choose to loose
time on this regexp check.
The problem i have is many people wants to enable cache on .gif and
.jpeg and .pdf, but they don't know the exact path.
Wouldn't it be easier to do a match on mime type, like ExpiresByType?
Bart
It could be great to do it by type, but it can have a big side effect.
Usually, resources not identified by extension are resources delivering
content based on dynamic information.
If these dynamic information are not in the query string, it's
definitively dead to do caching on this resource.
ex:
script.php?action=gimme_pdf will return a pdf content
Cookie: phpsessionid=JKHdheehKJHEDJKHhe
script.php?action=display_my_account return html.
Cookie: phpsessionid=6537656356753
There is nothing in the key to make the difference between two different
user, and in this case, user 1 who has his account page cached, user2
will see user1 account page...
So caching by mime type is good but when you have already identified
correctly the resource. We could imagine some CacheEnablePerMimeType and
CacheDisablePerMimeType.
IMHO, a regexp based cache enable or disable could be very usefull for a
default caching policy shipped with httpd.
We could do per default caching only on all images, css and all static
content.