cancel
Showing results for 
Search instead for 
Did you mean: 

Full Page Cache broken by email tracking parameters

Full Page Cache broken by email tracking parameters

We're running Magento CE 2.3.4 with built-in caching support, and we send out email campaigns using MailChimp, where customers are clicking through to our website using links that contain individualized email tracking parameters.

 

We have noticed that when customers click through to our site from such campaigns, Magento creates a separate full page cache entry for each customer's visit to each page, effectively invalidating most of the benefit of having the full-page cache (they don't revisit their own individual links often enough for this cache to be beneficial). I assume this is because the link parameters are being treated as part fo the full-page cache key. This also causes the load on our system to spike when an email campaign first goes out, due to all of the customers arriving at the same time, forcing Magento to serve the initial click on each link dynamically, not out of cache.

 

Ideally we would like to be able to tell Magento to ignore certain link parameters when constructing the cache key, because they don't affect the page content at all and there's no reason Magento should be caching each permutation of link parameters separately.

 

Any ideas on how to accomplish this, or best practices on how to handle full-page caching with email tracking parameters?

8 REPLIES 8

Re: Full Page Cache broken by email tracking parameters

Hello @cbdpeter 

 

are you using varnish then i have solution for that

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Full Page Cache broken by email tracking parameters

No, I am not using Varnish. I am using Magento's built-in caching.

Re: Full Page Cache broken by email tracking parameters

Anyone else have any ideas of how to handle this? It seems pretty inefficient to have a new cache entry created for each customer's unique clickthrough. There must be a way to avoid this issue.

Re: Full Page Cache broken by email tracking parameters

Just wanted to bump this question up - does anyone have a solution for getting Magento to ignore certain URL parameters when it caches/retrieves cache for a given page? For example, a given campaign that went out via MailChimp had the following parameters in the URL:

 

?utm_source=XXXXX
&utm_campaign=69e339b467-06112021_XXX
&utm_medium=email
&utm_term=0_031ac26c80-69e339b467-61320253
&goal=0_031ac26c80-69e339b467-61320253
&mc_cid=69e339b467
&mc_eid=d032d4541e

 

None of these parameters affect the layout or content of the page, so none of them are necessary for creation of a cache key. Some of the parameters are the same for all users, like: utm_source, utm_campaign, utm_medium - so they don't cause much of an issue. However, utm_term, goal, mc_cid and mc_eid are unique for every user, but are being treated as part of the cache key by Magento, so they effectively make it so none of the clicks from this email campaign are served from the cache.

 

Would love to figure out a way for Magento to ignore these parameters when caching these pages so that the pages could be served from cache for everyone who clicks through from a campaign.

Re: Full Page Cache broken by email tracking parameters

You have to define signal what URLs to ignore when looking at the cache.

Better use a Magento 2 plugin, most of these plugins will have that function

Refer this article for more detai

Re: Full Page Cache broken by email tracking parameters


@TutorialMagento wrote:

You have to define signal what URLs to ignore when looking at the cache.

Better use a Magento 2 plugin, most of these plugins will have that function

Refer this article for more detai


I checked out the article, but it seems to apply to Magento 1.x and not 2.x, which is what I am running. Also, I can't find anywhere to download their page cache plugin. Is it only available if you are a client of their service?

Re: Full Page Cache broken by email tracking parameters

What is your solution?

Re: Full Page Cache broken by email tracking parameters

I have not yet found a solution.