nikel
nikel

Reputation: 653

Leverage browser caching - Can't make max-age of Minify php work

I'm trying to do Leverage browser caching as pagespeed advices. I'm using minify ( https://code.google.com/p/minify/ ) for minifying and combining js and css.

The problem... I have following code included in the config file of minify

//default     $min_serveOptions['maxAge'] = 1800;
$min_serveOptions['maxAge'] = 604800;

However when I test my page on pagespeed, I'm getting warnings:

Leverage browser caching for the following cacheable resources:
http://www.mysiteaddress.com.tr/…=css&f=skel.css,style.css,style-wide.css (10 minutes)
http://www.mysiteaddress.com.tr/….min.js,js/skel-layers.min.js,js/init.js (10 minutes)
http://www.mysiteaddress.com.tr/min/f=js/analyticstracking.js (10 minutes)
http://www.google-analytics.com/analytics.js (2 hours)

Cache time has to be 7 days but google says it is 10 minutes and I think minify cache isn't working because tmp directory is empty (not when I test with xammp).

UPDATE: Cache is now working. I'm using full path for $min_serveOptions['maxAge']

My Files:
Root .htaccess: http://sudrap.org/paste/text/414120/
/min/.htaccess: http://sudrap.org/paste/text/414125/
Minify config code: http://sudrap.org/paste/text/414127/
/min/builder/.htaccess: http://sudrap.org/paste/text/414133/

Permissions of cache folder is set to 777.

How can I fix pagespeed warning?

Upvotes: 0

Views: 729

Answers (1)

nikel
nikel

Reputation: 653

This solved the problem:

config.php

$min_cachePath = '/var/www/html/domains/mydomain.com/httpdocs/min/tmp';

.htaccess

Header set Cache-Control "max-age=2592000, private, must-revalidate"

Upvotes: 0

Related Questions