jalmenarez / minify

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

Server cache files can stay stale if clocks out of sync #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Delete the server cache and request a Minify URL
2. Change and SFTP upload one of the source files from a Windows PC in a 
earlier timezone
3. Re-request the Minify URL

Minify should notice that the new file has a later timestamp and overwrite 
it. Instead, the file is transfered to the server with mtime of 1 or more 
hours ago, so the cache file mtime appears later and so is considered 
stale. This should only occur if the server is 1 or more hours ahead, and 
the user tries to make changes more frequently than the time gap.

The quick workaround is to touch files after uploading them, but the 
eventual fix will probably be a Minify static var $uploaderHoursBehind = 0 
(default), and this will be added to the mtime of source files when 
checking lastModifiedTime for the sources. 

If multiple Windows users from different TZs must upload frequent changes, 
I don't know a solution other than to have them touch the files after 
upload.

Original issue reported on code.google.com by mrclay....@gmail.com on 28 Jul 2008 at 5:55

GoogleCodeExporter commented 9 years ago
$uploaderHoursBehind is implemented in R160. I've put SVN on mrclay.org 
($uploaderHoursBehind = 1) and it's solved the problem for me.

Original comment by mrclay....@gmail.com on 29 Jul 2008 at 4:12