Last night I was in the process of launching an upgraded Magento site but ran into caching problems which ultimately caused me to postpone the launch.
My setup:
- New site (1.9): new.domain.com -> no cache
- Old site (1.7): domain.com -> memcache/redis/fpc
Both sites are on the same server in folders corresponding to their domain name
My process:
- Rename folder domain.com to domain.com.backup
- Rename folder new.domain.com to domain.com
- Create maintenance.flag
- Update .htaccess file to use domain.com instead of new.domain.com
- Rename /app/etc/local.xml to /app/etc/local.xml.backup
- Rename /var/cache to /var/cache.backup
- Rename /var/session to /var/session.backup
- Flush Magento cache, memcache and redis
At this point, I'm hoping to refresh the page and get the Magento installation page so I can upgrade the live database (after backing up of course). However, I received an error message about failing to open a stream in a PHP file at new.domain.com.
So the base URL of new.domain.com must have been cached by the Magento configuration but there was no way for me to clear it. Anyways, after several hours of trial and error I finally came up with a pretty ridiculous solution.
All I need to do when moving the site between domains is simply update the app/Mage.php file (e.g. download and reupload). No actual change to the file source is needed.
Now to my main question. Why does updating the Mage.php file seemingly result in the clearing of the Magento configuration cache?
@John
Thanks for the comment. I did suspect that the cache was invalidating due to the timestamp change to that file. I cleared the var/cache folder by renaming it but this had no effect since I'm using memcache instead of the file system for the standard Magento cache management.
It would seem that just simply using the Flush Magento Cache and Flush Cache Storage buttons do not actually cause the memcached configuration to be refreshed (along with flushing it from the command line). Updating Mage.php is the only thing that seems to trigger the refresh.