catalyst2 community forums  

Go Back   catalyst2 community forums > Support > Other Support Queries

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 10-07-2007, 10:27 AM   #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
robertc is offline   Reply With Quote
Old 10-07-2007, 01:13 PM   #2 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,537
Rob,

Which server are you on?
paulredpath is offline   Reply With Quote
Old 10-07-2007, 01:24 PM   #3 (permalink)
Registered User
 
Join Date: Jul 2003
Location: London
Posts: 22
Sorry, should have mentioned that: banana

Rob
robertc is offline   Reply With Quote
Old 11-07-2007, 01:04 PM   #4 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,537
Robert,

What line are you adding to your .htaccess to load the module.
paulredpath is offline   Reply With Quote
Old 11-07-2007, 10:30 PM   #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>
Rob
robertc is offline   Reply With Quote
Old 16-07-2007, 10:27 AM   #6 (permalink)
rob
Resident NetOp/*nix Geek
 
rob's Avatar
 
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
rob is offline   Reply With Quote
Old 26-07-2007, 01:07 PM   #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>
Rob
robertc is offline   Reply With Quote
Old 26-07-2007, 07:32 PM   #8 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,537
Thanks for the update robert.
paulredpath is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:04 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.