Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.7.15

Request #12179 File.php: Allow timestamp in constructor in place of masterFile
Submitted: 2007-10-03 09:54 UTC
From: mrclay Assigned:
Status: Open Package: Cache_Lite (version 1.7.2)
PHP Version: Irrelevant OS:
Roadmaps: 1.8    

 [2007-10-03 09:54 UTC] mrclay (Steve Clay)
Description: ------------ Cache_Lite_File is convenient when your cache validity depends on a single file, but it can't help you if you want validity to depend on a set of files, or, e.g., a timestamp from a database. I've made a small change to the constructor, allowing the user to give the option 'masterTime' (a unix timestamp) in place of 'masterFile'. This makes the class far more useful IMO. I've also updated the docs in File.php. E.g., to use a set of files as a master, you supply the max of the files' mtimes as 'masterTime'. I'm currently using this patch in a rewrite of "Minify", which combines, compresses, and serves CSS/Javascript files. If any of the files are modified, the 'masterTime' changes and the cache is invalidated.


 [2008-03-28 15:49 UTC] mrclay (Steve Clay)
Minify is now using the added 'masterTime' option to tie cache validity to multiple sources (instead of one file). You can see usage here: