Pre-Warm Magento Enterprise Full Page Cache

cachecronfull-page-cachemagento-enterpriseperformance

The performance benefits of the full page cache in Magento Enterprise are fairly well known. What may not be quite so well known is that for the full benefit of this to be realized, it must be fully populated and hot, particularly on large product sets where you don't have just a few pages thus making use of organic traffic to prime it speedy enough.

Magento includes a built-in cronjob to crawl the site and warm the FPC early in the morning.

I've seen and heard of issues caused by early morning jobs taking too long to run, blocking other jobs from running, and would like to know what others use or would suggest be used to do this. A couple ideas I have are:

  • Put together a shell script to crawl every page in the generated sitemap file.
  • Use a separate crontab entry and a short PHP script to bootstrap Magento and execute the crawler process directly.

Any thoughts and/or experience on this is welcome!

Best Answer

You could use siege in combination with the sitemap.xml file, like MageSpeedTest does.

#categories
curl http://yourmagentostore.com/sitemap.xml | sed 's/\<url\>/\<url\>\n/g' | grep 0.5 | sed 's/.*loc>\(.*\)<\/loc.*/\1/g' > urls.txt
#products
curl http://yourmagentostore.com/sitemap.xml | sed 's/\<url\>/\<url\>\n/g' | grep 1.0 | sed 's/.*loc>\(.*\)<\/loc.*/\1/g' >> urls.txt

Then run

siege -i -c 1 -t 7200s -f urls.txt

Content sourced from here.

Related Topic