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?