1

One page with 5 esi:include, each src is one same path with different params like 'm.htm?p=1' & 'm.htm?p=2', but I used varnishlog and see only 1 esi request happended, so don't I use one same path in more than one esi:include tag?

Hesey
  • 4,957
  • 6
  • 31
  • 31

1 Answers1

1

Varnish supports, by default, n esi:include directives per resource, and up to 5 levels of ESI recursion per client request, but that's configurable. Here's a list of steps I would take to debug:

  1. Check to make sure there are no <esi:include /> tags in the response delivered to your client from varnish. Then make sure your back end is generating as many <esi:include /> tags as you expect by hitting it directly. Varnish is to blame only if they exist and varnish is not parsing them. Make sure there are no typos, etc such as <es:include .../>
  2. Request the src urls from the esi include tags directly to your backend server. Does the server error out? The default behavior is to ignore errors on ESI requests, and I don't know if varnishlog will report them in this case.
  3. Check the response headers returned for the esi fragments. If they are also cacheable, varnish will not request them from the backend again until they expire and may not log them in varnishlog (check the docs).
  4. Make sure that requests with different query strings hash to different cache keys. If your VCL attempts to increase hit rate by ignoring query strings, your ESI scheme won't work since each tag is logically including the same cached resource.

Without knowing if you're just concerned with varnishlog output or whether there are actually symptoms of esi failure in the page itself that's all I can muster.

Johnny C
  • 1,799
  • 1
  • 16
  • 27