This is an old revision of the document!


Turn off cache on Cloudflare when using Magento and LiteMage

If you want to use cloudflare or other CDN in front of your Magento, make sure you turn off cache there, only enable media cache such as css,js,jpg etc. Otherwise, you will break Magento as well as LiteMage.

For example, if you see header from like the following:

"cache-control:public, max-ago=14400" 
"cf-cache-status: HIT"

then you already break your magento store and you should unset all these caches from CloudFlare. Why?

You will need to understand how Magento works. Magento requires frontend and frontend_cig cookie to be set. Also Magento need form key from each user for the validation process.

If cloudFlare cache was enabled incorrectly, then you can not get frontend and frontend_cig cookie in the header anymore. Hence all the form_key served from CloudFlare cache will be the same, which will cause Magento validation failure(require different form key from the different user. If user try to add the product to shopping cart or add to compare list, the operation will fail.

The solution is to clean all caches from Cloudflare but only keep media cache if you want to.

  • Admin
  • Last modified: 2017/11/07 22:11
  • by Jackson Zhang