Welcome to WebmasterWorld Guest from 54.221.30.139

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How to enable mod expires on Apache shared hosting?

     

ewwatson

5:42 pm on Nov 11, 2012 (gmt 0)

5+ Year Member



I'm trying to set up caching on my site. I have shared hosting at Hostgator. I have the code it my htaccess but it doesn't seem to be working. Talking to Hostgator teck support they say they don't have that on shared accounts. Is there anyway to enable it on my end? Thanks!

phranque

7:26 pm on Nov 11, 2012 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



if the module isn't loaded you cannot enable it.

ewwatson

12:18 am on Nov 12, 2012 (gmt 0)

5+ Year Member



Is there any alternative? Seems silly I can't do it when every single write up on the subject says I should cache my stuff. Possibly php

lucy24

2:56 am on Nov 12, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Most things written about most server behavior-- including Apache's own docs-- assume that it is your own server and you have absolute control.

What exactly does your non-working code say? Sometimes there is more than one way to achieve the same result. fwiw, headers and redirects fall into the same AllowOverrides category.

I doubt the config file says "no caching at all". It's probably got a default value.

phranque

3:03 am on Nov 12, 2012 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Is there any alternative?

another hosting provider or another level of hosting with your current provider which supports mod_expires.

you can provide an Expires header with your response if you are using php.
this might be helpful.
Conteg v0.13 available on PHP Classes - PHP Server Side Scripting forum:
http://www.webmasterworld.com/php/3277772.htm [webmasterworld.com]

ewwatson

10:02 am on Nov 12, 2012 (gmt 0)

5+ Year Member



Thanks guys for your response. It's funny just like 1000 other things, in a year from now this will be a trivial thing, but now it's a total unknown. I will try php once I've completely exhausted htaccess. I currently have this in my htaccess...

ExpiresActive On
ExpiresDefault "access plus 10 years"
ExpiresByType text/html "access plus 1 day"

I'm going to try mod_headers code now and see if that works.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month