Magento Full Page Cache Warmer Extend Cache Warmer and Add Custom URLsFull Page Cache Warmer

« Back to Magento Full Page Cache Warmer

The Cache Warmer will automatically generate a list of your product, category, CMS Page, WordPress blog and Splash page URLs and warm them for you. If you want to add custom URLs, the easiest way to do this is to add them to the Custom URL section of the Cache Warmer configuration in the Magento Admin. This works if you have a small amount of URLs but if you have a larger amount, you will find this method quite slow. For a large number of URLs, you should consider writing a small Magento module and using an event to add the URLs for you.

Add Custom URLs to the Cache Warmer

Let's start by creating the basic module files that we will need.


<?xml version="1.0"?>


<?xml version="1.0"?>


 * @category Fishpig
 * @package Fishpig_CacheWarmerCustomUrls

class Fishpig_CacheWarmerCustomUrls_Model_Observer
	 * Retrieve the message
	 * @param Varien_Event_Observer $observer
	 * @return Fishpig_CacheWarmerCustomUrls_Model_Observer
	public function addCustomUrlsToCacheWarmerObserver(Varien_Event_Observer $observer)
		// Get the transport object. This is used to pass the URLs back to the Cache Warmer
		$transport = $observer->getEvent()->getTransport();
		// Get the existing URLs. This stops URLs from other modules being overwritten
		$urls = $transport->getUrls();

		// Add a single URL
		$urls[] = '/custom-url.html';
		// Merge an array of URLs
		$urls = array_merge($urls, array(
		// Pass the new URLs back to the transport
		return $this;

You will need to change the URL generation part to include code to generate a list of the URLs that you require. These could be loaded from another module, from a CSV or using any method that you want. Just ensure that:

  • you first call $transport->getUrls() to get any URLs set by any other modules. You then add any new URLs to this array.
  • You pass the new array of URLs to the Transport via $transport->setUrls($urls)

Full Page Cache Warmer