2

I have a site on Godaddy Linux shared hosting and I wanted to improve caching for some elements, but apparently Godaddy did not install mod_expires. I see no other way to increase caching expiration for images and stuff (the default expiration time is apparently 15 seconds which is not very useful) and I was wondering why mod_expires is not installed.

I'd think it is also good for the hosting provider, because improving caching means less server requests, so it seems obvious it should be installed..

Is there a drawback of installing mod_expires from the hosting company's point of view? Do you know a possible reason why it's not available? I'm curious.

1 Answers1

2

Caching can be controlled via headers that are produced in the content.

The content could have the Expires: and Last-Modified: headers specified.

More details

Edit 1

These headers can be introduced as part of the content being served, which could apply to images as well.

This is something I've pushed through our development team in the past, as I prefer to cache static content on our proxies.

For your purpose, it sounds like mod_expires would be simpler.

mod_expires is probably not enabled because it is superfluous by default. Best practices tends to disable any unnecessary modules as part of initial configuration.

If you ask nicely and you're not using commodity hosting, maybe they'll enable it for you.

Edit 2

Just found this. If mod_headers is loaded, you can use it to set the expiration.

Using mod_headers

Warner
  • 23,440
  • 2
  • 57
  • 69
  • Yeah, but is it true for images too? I mentioned them explicitly in the question. –  Mar 03 '10 at 21:12
  • The PHP example is only for php and css. They use mod_expires for images. –  Mar 03 '10 at 21:20
  • But the real question is: why do I have to ask them to enable mod_expires? Isn't it something which is in their interest too? –  Mar 03 '10 at 21:21
  • It is technically possible with images. It's in their best interest to run the most efficient and secure system to meet the established requirements. Content expiration is not part of standard requirements for most one-size-fits-all Web hosts. – Warner Mar 03 '10 at 21:29
  • Thanks, mod_headers is apparently installed. I'll try this. –  Mar 03 '10 at 21:38
  • I understand content expiration may not be the part of standard requirements, but it is in their interest too, because if existing users hammer the servers less then they can serve more users from the same hardware which is good for business. –  Mar 03 '10 at 21:40
  • Awesome, glad to hear it. I understand your argument and it is totally legitimate. I'm simply sharing the perspective of the average host, as that was your question. – Warner Mar 03 '10 at 21:41