Magento Enterprise – How to Flush a Specific URL from Full Page Cache

full-page-cache

I had a look through Enterprise_PageCache_Model_Processor::extractContent() to see how it determines the cache key for each page that it caches, but it's pretty complicated and there doesn't seem to be a simple way to determine the cache key for a given URL in order to remove it from the cache…?

Best Answer

My guess (you didn't state the reason or use case for clearing a specific URL) would be to try to approach it by clearing the cache by tags. You could register an event at some point before the script terminates and call Mage::getSingleton('enterprise_pagecache/processor')->addRequestTag().

As you stated, the cache ID logic includes request and application environment information. You could poke around the Enterprise_PageCache_Model_Processor::_createRequestIds and Enterprise_PageCache_Model_Processor::_getFullPageUrl methods for more details on how they work.

Related Topic