Skip to main content

Diigo Home

Mosso : The Rackspace Cloud » Blog Archive » Coding in the Cloud - Rule 1 - Ca... - The Diigo Meta page

blog.mosso.com/...93-rule-1-cache-is-your-friend - Cached

This link has been bookmarked by 2 people . It was first bookmarked on 10 Jul 2009, by fulvius longhi.

  • 29 Jul 09
  • 10 Jul 09
    • It’s smarter to write your changes to a temporary file, which you then rename. If you’re serving cache.html and you want to update it, you open a new file and write it as cache.html.tmp. Then rename it cache.html. Since renaming is an atomic function, you’re never going to see a partial file, and it won’t interfere with active readers of the file.