Expires Headers |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Zymic Free Web Hosting - General Discussion & Help |
||
Expires Headers |
||
Mar 9 2012, 04:57 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 3 Joined: 9-March 12 Member No.: 233,536 |
Hello,
I'm trying to add the Expires header to some of my static resources however it looks like neither mod_expires nor mod_headers modules are not loaded. Is there a reason why these are disabled? If not, could you please enable the mod_expires module? Thank you |
|
|
![]() |
Mar 11 2012, 10:01 PM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 3 Joined: 9-March 12 Member No.: 233,536 |
While waiting for an answer I decided to try another solution that involves AddHandler and php_value auto_prepend_file directives in .htaccess that looks like
CODE <FilesMatch "\.js$"> AddHandler application/x-httpd-php .js php_value default_mimetype "text/javascript" </FilesMatch> php_value auto_prepend_file /path/to/expire-handler.php And expire-handler.php looks like CODE <?php $maxage = 60 * 60; header("Cache-Control: max-age=$maxage,public"); header("Expires: ".gmdate("D, d M Y H:i:s", time() + $maxage)." GMT"); ?> However that doesn't work and I'm getting a 500 error in .htaccess. Looks like the restrictions for htaccess are too severe. I consider that controlling the cache settings for site resources is pretty critical. How difficult is to enable mod_expires? |
|
|
![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 21st May 2013 - 05:51 PM |