We use Varnish (4) in front of an application which contains a few ESI blocks. What we are seeing (as expected) is that varnish streams the response from the server as soon as our backend responds to the initial request.
The issue with this is that the subrequests (ESI) can sometimes have pauses when loading (as they are not served out of the cache) and this causes noticeable 'loading jank' on the page.
We would prefer to have varnish wait until the whole response is ready before returning (I know this will increase the ttfb, but I think that the the perceived load speed is faster for our users).
- Is this a bad idea?
- Anyway to do this in varnish via configuration/vcl or do I need to run another instance of varnish in front of my instance of varnish (double varnish!).