Cache icon indicating copy to clipboard operation
Cache copied to clipboard

max-age not working on Windows if file already exists

Open fracz opened this issue 10 years ago • 2 comments

When I run the max-age.php script from demo directory, this is the output:

$ php max-age.php
First call: generating file...
Waiting 4s...
Third call: generating cache file, because it expired...

But when I run it once again:

$ php max-age.php
First call: generating file...
Second call: generating file, this should not happen!...
Waiting 4s...
Third call: generating cache file, because it expired...

My OS is Windows 7 x64 and

$ php -v
PHP 5.5.9 (cli) (built: Feb  5 2014 13:02:39)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

fracz avatar Oct 30 '14 19:10 fracz

Hello This is likely related to the behaviour of filemtime () on win32 Need to investigate

Gregwar avatar Oct 30 '14 19:10 Gregwar

Changing filectime to filemtime in Cache.php line 181 worked for me on windows.

mchev2 avatar Nov 02 '15 15:11 mchev2