Cache
Cache copied to clipboard
max-age not working on Windows if file already exists
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
Hello This is likely related to the behaviour of filemtime () on win32 Need to investigate
Changing filectime
to filemtime
in Cache.php line 181 worked for me on windows.