4

We have a lot of very small blocks that we want to include with an ESI in an Symfony2 application. To be concrete, it is about rating stars that get displayed in a list of products and about an user avatar and rank which gets displayed in a list of comments. So we talk about very small pieces of information for list items. A part of the question is also that those small blocks do not need an URL, but to render them as ESI i need to give them an URL. Is it an design flaw to do this, because for me, making those block public available with an URL feels like an design flaw.

Maximilian Ruta
  • 518
  • 7
  • 18
  • 1
    If you have a lot of users, a lot of stars and a lot of avatars, you might end up not gaining any performance due to the overhead created by making dozends of esi calls for every website. – Andresch Serj May 12 '14 at 10:08
  • Are there any benchmarks on how high the performance impact is if the ESI round tips an native reverse proxy like varnish? Okey, of cause if the block itself is not cached in the reverse proxy, the reverse proxy will have to ask the application for the block which of cause is very expensive. – Maximilian Ruta May 12 '14 at 10:16
  • Not that i know of. Only had a co-worker in a project where they refactored the massive usage of ESI due to the problem you just described and the massive overhead that didn't gain them anything in the long run. – Andresch Serj May 12 '14 at 10:21
  • This is the reason why I have separated my ESIs into an Twig Extension. http://stackoverflow.com/questions/23607642/is-it-good-practice-to-put-edge-side-includes-into-my-templates – Maximilian Ruta May 12 '14 at 11:27

1 Answers1

0

Your idea of a large amount of ESI blocks is not a very good one with varnish. The reason is that ESI requests are never issued in parallel. It's a coming feature and I think the release of 4.0 made it a lot closer, but it's not there.

A better solution would probably be to tag your pages according to the user user ids and then do tag banning/purging.

Clarence
  • 2,944
  • 18
  • 16