Showing results for 
Search instead for 
Did you mean: 

Magento edge cache with cookie bypass

Magento edge cache with cookie bypass

We are trying to setup magento edge cache with cloudflare including html. The url route of bypassing cache on urls alone e.g. /customer, /admin, etc doesn't really work bcoz e.g. when a customer logs in the page shown to him is still homepage.


In summary we managed to get it working pretty well through bypassing edge cache on the presence of certain cookies which were





We soon realized that by simply visiting a product url without even being logged in Magento introduced PHPSESSID so cloudflare stopped delivery from its' edge servers. So, we tried setting up cloudflare edge cache including html once again by disallowing cache in presence of private_content_version and admin cookies only. This strategy seems to work as long as the visitor doesn't add anything to its cart! As soon as the visitor adds anything to the cart the private_content_version cookie is introduced which forces cloudflare to go dynamic and stop delivering from its edge cache servers.


The point of this post is to get any out of the box ideas from experienced veterans or tinkerers. I have been studying that private_content_version has something to do with browser's local storage & disabling full page cache removes it. But I fear any disabling of fpc on my part will terribly hurt response times for my logged in visitors.


I seek ideas, knowledge and experience in the matter. Any help will be greatly appreciated, thanks.


Magento edge cache with cookie bypass

Implementing edge cache with cookie bypass in Magento helps improve site performance by caching content while allowing dynamic content updates based on cookies. This ensures fast loading times and personalized user experiences.