Setting an expiry date in the HTTP headers

carlosBabel

Registered
Dec 28, 2012
1
0
1
cPanel Access Level
Website Owner
How do I Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network?

Basically I need to set Expires & Last-modified to set caching headers aggressively for all static resources

I've read documentation and it seems i should do it over easyapache, but i dont have access to that option in my whm. Im not the server administrator. Thank You, sorry for my english :(
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
mod_expires can be enabled or disabled using EasyApache by the server administrator. You need to ask the server administrator (your host) whether mod_expires is available.

If mod_expires is available, you can use its directives in .htaccess files, which do not require root (administrator) access. The Apache documentation explains the mod_expires directives you can use:

mod_expires - Apache HTTP Server

Note that it says:

Context: server config, virtual host, directory, .htaccess
for each of the directives, so you can use them in .htaccess files, unless your host has disallowed your capability to override directives. That is a possibility, so you need to ask your host exactly what is allowed.

A search for "last-modified .htaccess" in your favorite search engine will give you a list of several documents that offer suggestions for using or removing last-modified from the header.