How to use hole punching in magento 2?

Status
Not open for further replies.
#1
The following site claims that litemage supports hole punching (ESI)
But I can't find any practiable examples on how to mark a block or certain code in a template as private.

Are there any practiable examples or is there a documentation for magento 2?

EDIT: I can't post the link properly, I get "Your content can not be submitted. This is likely because your content is spam-like or contains inappropriate elements."

www . litespeedtech . com/products/cache-plugins/magento-acceleration/hole-punching
 

serpent_driver

Well-Known Member
#2
You should prefer an AJAX solution instead of ESI. ESI is a great thing, but it can almost completely destroy cache performance in case of Magento.
 
#3
You should prefer an AJAX solution instead of ESI. ESI is a great thing, but it can almost completely destroy cache performance in case of Magento.
Ok, I got you. But I would like to test it nevertheless.

Where can I find any practiable examples or is there a ESI litemage documentation for magento 2?
 
#5
Thank you, that worked! :)

This is the response I got from the support btw:
"We don't have any dev doc for LiteMage.
If you are an advanced Magento 2 developer, you can check LiteMage code and should be able to figure out how ESI is implemented.

If you have further questions after that, you can join golitespeed slack channel to reach out Lauren at LiteSpeed."
 
Last edited:
#7
Thx @serpent_driver. I will look into it. Can you tell me the advantage of LiteCache over LiteMage? (EDIT: ok, I see they are listed on the website)

I am an advanced magento 2 developer. A developer shouldn't have to investigate the code for basic informations like that. Code should be documented. However she gave me this information:

ESI block is standard for M2. It's same as when you use varnish. add the ttl attribute to a block in your layout file, will make that block as an ESI block. Like in this article mentioned. When it's not cacheable, you use cacheable="false", when it's publicly cacheable, you add ttl="3600", it means it's a publicly cacheable block for 3600 secs.
We did have a secret config for private cacheable block. Private means each user will have its own copy. use ttl="-3600". a Negative number will make the block cached privately.

Usually introduce ESI blocks will slow down things, as by default M2 assume you will use ajax for private data, like items in cart.

We'll update our docs to mention it. Sorry for the confusion.
 
Last edited:

lclarke

Administrator
Staff member
#11
Hi, @eddcapone. I'm the one who updated the docs with the information you requested. If there's anything else you need to know, be sure to ask. We can't provide full developer docs for updating Magento layouts, but we will happily share helpful information about integrating our cache/ESI implementation where we can.
 

serpent_driver

Well-Known Member
#13
@lclarke Thx! This should have been in the documentation from the beginning, it would have saved us alot of time.
LiteSpeed's documentation for whatever topic is faulty and incomplete, so you have to verfify by your own if a promised function works.

It's sad that it's like that, but that's the way it is. LiteSpeed is just a small company with only a few employees, and the few employees don't have time to document anything because they don't get paid to do so. So you're on your own and have to figure out if there's a bug or LiteSpeed doesn't provide the feature you need.

If you want first level support that solves any issues within 24 hours use LiteCache instead. We are not LiteSpeed, but we act like LiteSpeed should!
 
Last edited:

lclarke

Administrator
Staff member
#14
That's not entirely a fair assessment. LiteSpeed is indeed comprised of a small team, and it's not always possible to be as proactive as we'd like. But the documentation team does try to be as responsive as possible, and when we see a hole in our docs, we fill it quickly.

Anyway, I'm sorry that this particular issue took a while to get to the docs team. Be sure to let us know if you have any other questions!
 

serpent_driver

Well-Known Member
#15
That's not entirely a fair assessment. LiteSpeed is indeed comprised of a small team, and it's not always possible to be as proactive as we'd like. But the documentation team does try to be as responsive as possible, and when we see a hole in our docs, we fill it quickly.

Anyway, I'm sorry that this particular issue took a while to get to the docs team. Be sure to let us know if you have any other questions!
Who is talking about fairness?

It's all about the fact that LiteSpeed apparently doesn't have the manpower to publish the features, but also the special features and their outstanding advantages. This creates a significant discrepancy. If LiteSpeed invested more in publishing the advantages of all LiteSpeed products, then LiteSpeed would be the market leader after 23 years. At least in terms of web servers. If it were about fairness, then it would be unfair to appropriately recognize the achievements of LiteSpeed employees by promoting the achievements of the employees and thus also of LiteSpeed. Unfortunately, this commitment fizzles out because you in particular are not doing your job properly.
 
Status
Not open for further replies.
Top