soyturk / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

cache maxAge #248

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Did you try code from the master branch: https://github.com/mrclay/minify ?
yes

Are you sure this is not a problem with your configuration? (ask on the Google 
Group)
no

Minify commit/version:2.1.4
PHP version: 5.2.17

What steps will reproduce the problem?
cache expiration date is overwritten

GROUPSCONFIG.PHP file =
return array(
    'plugins' => array('//js/jquery.address.js','//js/mylibs/helper.js','//js/plugins.js'),
    'scripts' => array('//js/script.js'),
    'ie' => array('//js/libs/ie9.js','//js/libs/selectivizr-min.js','//js/libs/imgsizer.js'),
);

CONFIG.PHP file = 
$min_serveOptions['maxAge'] = 2000000000;

Expected output:
min/g=plugins ( but also min/g=scripts ) Cache-Control:max-age=2000000000

Actual output:
Cache-Control:max-age=2000000000, max-age=60

cache max-age is overwritten to 60 ms

Original issue reported on code.google.com by daniele....@gmail.com on 9 Nov 2011 at 3:42

GoogleCodeExporter commented 9 years ago
If you're seeing two "max-age" values, then one of them has to be being altered 
outside PHP (by your web server I assume). The code that writes the 
Cache-Control header in Minify is here (it can't write two values):
https://github.com/mrclay/minify/blob/master/min/lib/HTTP/ConditionalGet.php#L15
5

If you make an empty PHP file and call it, does it send 
Cache-Control:max-age=60 by default?

Original comment by mrclay....@gmail.com on 9 Nov 2011 at 5:43

GoogleCodeExporter commented 9 years ago
shame on me.

you are right, i've an .htaccess in root (mostly based on 
https://github.com/laukstein/ajax-seo/blob/master/.htaccess )
 so /min is excluded from redirects, but not from max-age settings

thanks for all

Original comment by daniele....@gmail.com on 10 Nov 2011 at 12:53

GoogleCodeExporter commented 9 years ago
Daniele, does https://github.com/laukstein/ajax-seo/blob/master/.htaccess still 
returns you any error?

Original comment by laukstein on 22 Jul 2013 at 6:04