Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are ESI blocking or non-blocking?

I'm planning my caching strategy and I'm digging into ESI to see if it fits my needs.

Today these questions arose:

  • Is each include executed in serial or parallel? Say I have 5 of these: {% render '...' with {}, {'standalone': true} %}. I understand that the resulting page will have to wait for all of them, but the time it will take, will it be similar to the slowest of the includes, or will it be similar to the sum of all those includes?
  • If the answer is 'serial', is there a way to turn it into parallel?
  • Am I better off just using Ajax for the user-specific parts of the website? In which cases would you pick one or the other?
like image 897
ChocoDeveloper Avatar asked Nov 26 '12 03:11

ChocoDeveloper


1 Answers

ESI with varnish is always executed in serial. They put alot of work on improving ESI with varnish 3, but still no change in that aspect. I also remember seeing some response from varnish staff saying that the feature was on their wishlist but was a tricky one to implement.

For making paralell now I guess the only option would be to implement the feature yourself.

As for Ajax vs ESI I would say the break point goes later than 5 ESI as long as they can be rendered quickly by your backend. Ajax always has the drawback of being bad SEO if used for content parts of your site.

like image 73
Clarence Avatar answered Sep 22 '22 03:09

Clarence