Well, if you use full-page HTTP cache but you need to have some parts on your page that cannot be cached - it makes sense to use "render_esi(controller())". But it causes a sub-request to your application, that means you instead of 1 request to your application you get 2: 1 main request and one sub-request. If you want to do it in a loop - it will increase sub-requests number.
So, that's not a good idea, but it depends on your loop and your needs. If there's no way to get rid of those render_esi(controller()) in loop for you - probably it's OK, but I'd recommend to profile your application performance, it may cause slow response time on load.
I hope this helps!
Cheers!
Please, log in to vote for this comment
|
Share Comment
"Houston: no signs of life" Start the conversation!
2 Comments
Is it good or bad practice to set a render_esi(controller()) inside loop for even with a cache layer ?
Hey Ahmed,
Well, if you use full-page HTTP cache but you need to have some parts on your page that cannot be cached - it makes sense to use "render_esi(controller())". But it causes a sub-request to your application, that means you instead of 1 request to your application you get 2: 1 main request and one sub-request. If you want to do it in a loop - it will increase sub-requests number.
So, that's not a good idea, but it depends on your loop and your needs. If there's no way to get rid of those render_esi(controller()) in loop for you - probably it's OK, but I'd recommend to profile your application performance, it may cause slow response time on load.
I hope this helps!
Cheers!
"Houston: no signs of life"
Start the conversation!