Questions tagged [mod-expires]

Mod_expires is an Apache module that deals with cache expiry headers.

133 questions
49
votes
10 answers

Stop browser to make HTTP requests for images that should stay cached - mod_expires

After reading many articles and some questions on here, I finally succeded in activating the Apache mod_expires to tell the browser it MUST cache images for 1 year. ExpiresActive On ExpiresDefault "access plus…
Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
47
votes
4 answers

How to make static content on Apache be cached by browser and not checked for freshness with every request?

How can I get static content on Apache to be {cached by browser} and not {checked for freshness {with every request}}? I'm working on a website hosted on Apache webserver. Recently, I was testing something with headers (Content-Type for different…
Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222
46
votes
2 answers

Which one to use : Expire Header, Last Modified Header or ETags

I am running PHP on Apache, and am confused about how to implement server-side caching, in order to make the site load faster. What is the difference between the Expires, Last-Modified and ETag headers, and which one should be used in what…
Avinash
  • 6,064
  • 15
  • 62
  • 95
28
votes
4 answers

How to check mod_headers and mod_expires modules enabled in apache

I want to check whether mod_headers and mod_expires modules enabled or not in my server Is there a way available to list apache enabled/disabled modules using some php function just like we list php information with phpinfo(); function?
Giri
  • 4,849
  • 11
  • 39
  • 48
25
votes
1 answer

how to use mod_headers and mod_expires to cache

I want to cache images and other files on my site, so what I did is made sure mod_headers and mod_expires with :- /usr/sbin/httpd -l then edited .htaccess to be:- ExpiresActive On ExpiresDefault A0 # Set up caching on media files for 1 year…
user614963
  • 823
  • 3
  • 9
  • 13
21
votes
3 answers

Apache FilesMatch - matching a folder in the regular expression

I'm trying to cache some files using a .htaccess file for Apache2. I want to cache a particular folder longer than anything else, so i've been trying to use the FilesMatch directive like this:
fistameeny
  • 1,048
  • 2
  • 14
  • 27
17
votes
2 answers

Apache: set max-age or expires in .htaccess for directory

I have a handful of directories with content which will never change. Is it possible to create .htaccess file which tells the browser that anything in this directory and sub- directories can be cached for a very long time? I would like to copy…
Brian McGinity
  • 5,777
  • 5
  • 36
  • 46
15
votes
4 answers

Cache Expire Control with Last Modification

In Apache's mod_expires module, there is the Expires directive with two base time periods, access, and modification. ExpiresByType text/html "access plus 30 days" understandably means that the cache will request for fresh content after 30…
bushman
13
votes
1 answer

XAMPP how to load mod_expires

I have XAMPP, and I can see the file mod_expires.so under path ...XAMPP\apache\modules\mod_expires.so However, I believe the module is not loading for two reasons: first: mod_expires is not listed when call phpinfo() second, is I add cache…
IberoMedia
  • 2,226
  • 7
  • 36
  • 61
10
votes
3 answers

Overwrite cache-headers with mod_expires

I want to set cache-headers using the mod_expires module from apache. My configuration looks somewhat like this: ExpiresDefault "access plus 1 years" The problem is, that the files are generated by a…
scheffield
  • 6,618
  • 2
  • 30
  • 31
9
votes
2 answers

How to set up mod expires for fonts

I'd like to set expiry date for fonts. Following definition isn't working on apache 2.2.15. ExpiresByType application/x-font-woff "access plus 1 month" ExpiresByType application/font-woff2 "access plus 1 month"
user3796291
  • 169
  • 1
  • 2
  • 12
9
votes
2 answers

Add Expires Headers for Specific Images

All of the expires headers articles I've looked at give more or less the following solution: ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/jpeg A2592000 But it doesn't make…
HandiworkNYC.com
  • 10,914
  • 25
  • 92
  • 154
8
votes
1 answer

mod_expires sending Cache-Control headers for 3## status codes

Apache is sending Cache-Control headers for 3## status codes, like 302 redirects. This is causing Firefox (possibly starting with Firefox 5) to cache the 302 redirects--which results in an infinite redirect loop for some of my pages. Here are the…
Joe Lencioni
  • 10,231
  • 18
  • 55
  • 66
8
votes
3 answers

Apache2 mod_expires not working

I have recently deployed a website on a VPS that supports Apache2, and was working on performance improvement suggestions by YSlow. Among those improvements were using mod_deflate and mod_expires, and since I have root access, I can directly edit…
Khorkhe
  • 1,024
  • 1
  • 11
  • 26
8
votes
1 answer

htaccess / mod_expires - caching specific files

Ok, I checked a lot of websites about how to manage the browser's cache memory with a .htaccess file, but it is still very not clear to me. I want to cache specific files for one month. For the rest, I want it to be refreshed every time. So I…
Sharcoux
  • 5,546
  • 7
  • 45
  • 78
1
2 3
8 9