![]() |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2003
Location: London
Posts: 22
|
mod_expires support?
I was playing around with the .mobi readiness evaluator yesterday and one of the things my sites failed on was 'No cache-control or expires headers detected' on static files. I had a google and found that mod_expires was the thing for this on Apache, but any attempt to activate it through .htaccess files resulted in a 500 error. I assume, therefore, that the module is not available on catalyst2 servers? If I'm assuming wrong, can someone please give me some pointers as to the correct syntax I should be using in .htaccess to enable it?
Rob |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Jul 2003
Location: London
Posts: 22
|
I tried a couple of different things from some tutorials I found on the internet:
http://www.askapache.com/htaccess/sp...s-caching.html http://www.mnot.net/cache_docs/ http://www.linuxdevcenter.com/pub/a/...ly.html?page=1 When none of that worked I looked up where the module was on a local Centos box I had and put in that path. This is what I ended up with (didn't keep the prior versions) and was still getting 500 errors: Code:
LoadModule expires_module /usr/lib/https/modules/mod_expires.so ### activate mod_expires ExpiresActive On ### Expire .gif's 1 month from when they're accessed ExpiresByType image/gif A2592000 ### Expire everything else 1 day from when it's last modified ### (this uses the Alternative syntax) ExpiresDefault "modification plus 1 day" ### Apply a Cache-Control header to index.html <Files index.html> Header append Cache-Control "public, must-revalidate" </Files> |
|
|
|
|
|
#6 (permalink) |
|
Resident NetOp/*nix Geek
Join Date: Dec 2003
Posts: 223
|
Robert,
mod_expires is loaded on the server by default - we do not allow LoadModule in .htaccess. Please try removing the loadmodule directive, and trying the .htaccess file then. If this is not effective, please open a ticket via shared@support.catalyst2.com or http://support.catalyst2.com Thanks, Rob
__________________
Rob Shakir - rob@catalyst2.com |
|
|
|
|
|
#7 (permalink) |
|
Registered User
Join Date: Jul 2003
Location: London
Posts: 22
|
Just an update, I've not managed to look at this until today but I seem to have it working now. For anyone else, this is what the relevant section of my .htaccess now looks like:
Code:
<IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 1 day" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" ExpiresByType text/html "access plus 1 week" ExpiresByType application/x-shockwave-flash "access plus 1 month" </IfModule> |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|