Ken Kingsbury wrote: > Hi, > > I've scanned the archives but can't see that my issue has been talked > about before... apologies if it has. > > When new Mason-handled content is FTPed to our site we sometimes see > that the content served by Mason is incomplete or broken. When we look > at the source HTML it seems fine and if we touch the file to force > Mason to re-cache it, it fixes the incomplete/broken cache file. > > We speculate this is what's happening: > - an HTTP request for a file being FTPed is received by the web server; > - Mason sees that the file has been updated and caches the file before > the FTP is complete; > - The FTP completes in the same second that Mason caches the file so > that in subsequent requests for the page Mason thinks its cache is > up-to-date (the last modified times of both the original and cached > files are the same) and continues to serve an incomplete/broken page > until we touch the original file, forcing Mason to re-cache it. > > Is this a sensible scenario? Are file last-modified times measured in > seconds (and not something more granular)? > > Our intuition is that this is only happening with very popular pages > (subject to strict publishing deadlines --so it's important they are > not incomplete/broken)... it never seems to happen with less visited > pages. If there are many clients looking for a page just at the time > it's being published (FTPed) the chances of Mason caching the file > before it's completely FTPed seem good. > > I now usually FTP to a temporary name and then rename the file to its > final name -- so that when Mason becomes aware of the updated file the > FTP is complete.
I'd suggest looking at the static_source_touch_file option. On top a slight performance increase (one stat every request, instead of every component call) it eliminates this problem. You upload whatever you need to, then touch the magic file. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users