GordonLesti / Lesti_Fpc

Simple Magento Fullpagecache
https://gordonlesti.com/lesti-fpc-documentationversion-1-4-5/
Other
358 stars 158 forks source link

Uri Params: Add UTM Parameters #274

Closed sprankhub closed 7 years ago

sprankhub commented 7 years ago

Is it correct that the "Uri Params" are used in order to cache different versions of the page depending on the param value?

If this is the case, I vote for adding the following parameters by default:

These parameters are used by many clients for analytics. Or maybe it is even better to add /utm_.*/ since there are other params like utm_content.

Do you agree? I can send you a PR then.

sprankhub commented 7 years ago

The reason why there should be different versions of these pages is that Magento, by default, keeps the URI params in links to other pages. If you e.g. call a category page with a param a=b in the URL, the link to the second page of the category will also include the param a=b.

GordonLesti commented 7 years ago

Hello @sprankhub yes Uri Params are used to create different entries in the cache depending on the value of those parameters. I guess Magento is just keeping the parameters in the links if the argument $params of Mage::getUrl contains '_current' => true. Unfortunately is that the case in Mage_Catalog_Model_Layer_Filter_Item::getUrl. I guess @Webmasterei had the same issue with the parameter adword. I am not sure how to solve such a problem, but I guess adding adword, utm_source, etc. to Uri Params is not the best solution, cause it will increases the _MISS_s, decreases the _HIT_s and blows up the cache size dramatically.

sprankhub commented 7 years ago

Exactly, e.g. the filters include these links. Hence, this is a big issue. It of course increases misses, decreases hits and blows up the cache, but since we need different versions of the page, I think this is okay. How should another solution look like? Make blocks, which include such links, lazy? I do not think that this is a better solution...

GordonLesti commented 7 years ago

Yes, I have no clue at the moment to solve this problem without adding to Uri Params, but I would add those parameter reluctantly as default to the code base of FPC.