

$productID = '760' // This is the Magento ProductID of the item you want to purgeĬurl_setopt($curl, CURLOPT_CUSTOMREQUEST, $varnishcommand) Ĭurl_setopt($curl, CURLOPT_HTTPHEADER, ) 6 Answers Sorted by: 35 Blocks can be set as non-cacheable by setting the cacheable attribute false in layout XML files.
MAGENTO 2 PRIVATE CACHE FULL
Examples of public content includes the header, footer, and category listing. Declare a block that disables full page cache on parent pages Declare a block as a ESI blockes Implement cache-friendly block that is rendering private.

So I added in a cURL request to complete the specific purge : $varnishurl = "$varnishcommand = "PURGE" As Magento 2 documentation pointed out, there are two types of content, public and private: Public, which can display to many customers Public content is stored in your cache storage (file system, database, or Redis), or by Varnish. $productID) įor those people running Varnish with Magento too, it's also necessary to purge the data there as well as the Magento call doesn't appear to do it completely.

$cacheManager = $objectManager->get('\Magento\Framework\App\CacheInterface')
MAGENTO 2 PRIVATE CACHE CODE
The correct code is : $objectManager = \Magento\Framework\App\ObjectManager::getInstance() Thanks I managed to get some error logging in there and quickly found out that the namespace for the cacheManager was slightly wrong.
