Closed (outdated)
Project:
ESI: Edge Side Includes
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Dec 2011 at 06:08 UTC
Updated:
22 Jul 2019 at 16:03 UTC
Jump to comment: Most recent
Comments
Comment #1
mikeytown2 commentedThis is not as big of an issue now that ESI (6.x-2.x) can use the built in page cache. This deals with varnish configuration.
Comment #2
djbobbydrake commentedWhen you say "ESI (6.x-2.x) can use the built in page cache", if the session cookie isn't unset, we're still not retrieving the cache from Varnish, correct? Can you explain more "This deals with varnish configuration." How can I configure Varnish to serve a cached page (when I say cached, I mean by Varnish, not the Drupal page cache) to an authenticated user, while still having ESI blocks work that display stuff such as the user's username?
Comment #3
mikeytown2 commentedGo to
admin/settings/esiand under "Global Settings" enable "Use Core's page cache to store ESI fragments." This is the quick and dirty way to get it working without changing your varnish configuration.For a more in-depth look checkout http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal and look for the code block that contains
set req.http.Cookie = ";" + req.http.Cookie;; read up on that section.Once you have a good understanding of that you need to checkout the esi_blocks-2_0.vcl file. You might want to change
"USER"to2and"ROLE"to1in that code.Documentation is lacking, so documenting the steps you had to take in order to get it working would be helpful for everyone :)
Comment #4
djbobbydrake commentedWhat's the benefit of serving ESI fragments from Core's page cache vs from Varnish? Wouldn't it be faster to serve the ESI fragments from Varnish?
Comment #5
mikeytown2 commentedVarnish is faster, but it can be complicated to setup. If you're asking why core's page cache is used at all, ESI does support AJAX loading.
Comment #6
kentr commentedNot sure I'm understanding correctly, so this comment may not apply:
Varnish can cache items that have a cookie. Change the vcl file to allow this. Example here.
Comment #7
dstuart commentedNo longer supported