Open mackski opened 7 years ago
Got the same problem. I haven't tried your solution but isn't there a problem with adding a string to the timestamp because it is used for the arithmetic + operation in the next iteration?
I did basically the same but using the decimal hash of the filename:
$_timestamp = ($_timestamp + $file['last_modified'] + hexdec(md5(basename($file['absolute_path']))));
We also had this problem. My fix:
private static function _getCacheName($files, $prefix = 'css_', $ext = '.css') {
$hash = md5(print_r($files, true));
return (self::$developmentMode !== true) ? $prefix.$hash.$ext : $prefix.$hash.'_dev'.$ext;
}
If an array of filenames are passed, and all files have the same modified timestamp on separate pages a collision will occur and the wrong file is served for subsequent pages.
eg: Page 1 - array('file1.js','file2.js'); Page 2 - array('file1.js','file3.js');
Each file has the same timestamp (ie; rsync or similar copy operation).
Simple fix:
$_timestamp = ($_timestamp + $file['last_modified'] . basename($file['absolute_path']));