Hello

I've a problem with the cache expire indicate in the headers of files generate with advagg.
The cache expires is only of 15mn.

Accept-Ranges	bytes
Cache-Control	max-age=900, no-transform, public, immutable
Content-Encoding	gzip
Content-Length	17076
Content-Type	text/css
Date	Tue, 25 Apr 2017 13:04:59 GMT
Expires	Tue, 25 Apr 2017 13:19:59 GMT
Last-Modified	Mon, 24 Apr 2017 15:08:12 GMT
Server	Apache
Set-Cookie	xxlplan=R908334566; path=/; expires=Tue, 25-Apr-2017 14:04:18 GMT
Vary	Accept-Encoding
X-Content-Type-Options	nosniff
X-XSS-Protection	1; mode=block

How to increase the cache expires time ?

Thanks in advance

Comments

selinav created an issue. See original summary.

mikeytown2’s picture

What server are you running on? Apache, Nginx, ect? The Cache-Control configuration depends on that. AdvAgg has a default of 52 weeks if using Apache.

mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)
selinav’s picture

Hello,

It runs on Apache on ovh share hosted.
Finally, to fix it I've added this on my htaccess to increase cache time.

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

   ExpiresByType text/css "access plus 2 week"
   ExpiresByType image/jpg "access plus 2 week" 
   ExpiresByType image/jpeg "access plus 2 week" 
   ExpiresByType image/png "access plus 2 week" 
   ExpiresByType image/gif "access plus 2 week"
   ExpiresByType text/javascript "access plus 2 weeks"
   ExpiresByType application/javascript "access plus 2 weeks"
   ExpiresByType application/x-javascript "access plus 2 weeks" 
mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Active

Ok good to know; the default above what you added should have taken care of that for you

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

Which means you have a specific rule in your .conf file making these files only last for 15 minutes.

I'll see about better documentation for this issue.

mikeytown2’s picture

Status: Active » Closed (works as designed)

Checked the readme and this is already documented.