Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When we deploy we create a timestamped folder in a versions folder. After it's done cloning from git we unlink the symlink, and create a new one to the new versioned folder. We reload apache (not a full restart) and when we refresh the pages it takes several refreshes (sometimes for minutes) until it stops serving a mix between old and new content.

I am assuming this is due to stale apache workers, or Rackspace servers caching on file system level? (I have tried forcing the ln command to "go faster" with sync, but with no change)

So for example 1. doc_root/ -> versions/12345 2. Deployment, create 67890 folder, checkout 3. unlink doc_root 4. symlink doc_root/ -> versions/67890 5. Reload apache 6. Refresh pages for minutes and it will serve content from 12345 and 67890.

Am I missing something that I could do to ensure this doesn't happen? Is this a case against symlinks? Should we be swapping directories around with mv instead?

share|improve this question
1  
Are you certain this is apache and not a cached page in your browser or a proxy? –  Jenny D Jan 23 at 9:01
    
Caching wouldn't explain why on one refresh we see old content, on the next new content, on yet another refresh old content. There's no cache/proxy in front of our server. –  jlindenbaum Jan 23 at 16:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.