Varnish does not seem to cache properly the ESI fragment.
I have set up varnish locally and tested it to make sure it works properly by pointing to a static HTML and then by fully caching the page and seeing the two X-Varnish keys. Both show cache keys and drastic improved performance. The next thing was to test esi fragments by making the footer pane be cachable via esi. The esi module is successfully adding the esi tag and looks something like this:
<esi:include src="http://mylocalsite.co:8080/forums/esi/panels_pane/ibase%3A29%3A279/0/aG9tZQ%3D%3D" />
ESI Markup Shows but SRC Leads to 503 Service Unavailable
http://mylocalsite.co:8080/forums is the root of the application and when I searched for the esi/panels_pane folders in the root, they were not there. Clicking on the link seen in the src leads to a 503 Service Unavailable. Adding them manually does not seem to help at all, or at least, there is nothing that gets dumped in there. I imagined is saved into memory only?
Steps to Reproduce
- Set render mode to ESI in /admin/config/development/esi
- Go into a panelized page and make one of the panes be cached as ESI
- Ensure varnish is running
- Preview site on the port varnish is listening to (my case is port 8080)
- Now the pane that has be made a fragment may or may not render a 503 notice in addition to the pane HTML itself.
- Looking at the source code reveals that the esi tag is there but when you click on the src link it always take you to a 503 page.
ESI Modules Used
- ESI - Block
- ESI - Edge Side Includes
- ESI - Panels
- Varnish (Not sure if I needed anymore)
default.vcl
- default.vcl pastebin.com/yaW0hZeL
- esi_blocks.vcl pastebin.com/1CMr6q4E
- drupal.vcl pastebin.com/cz7zNDqQ
My Configurations
- Varnish 3.0 varnishd (varnish-3.0.3 revision 9e6a70f)
- Drupal 7
- esi module - 7.x-3.x branch
Does anyone know what am I missing? Is the vcl file correct or missing something?
Comments
Comment #0.0
sam3k CreditAttribution: sam3k commentedremoming brackets from HTML tag so it shows to the user
Comment #0.1
sam3k CreditAttribution: sam3k commentedrephrasing question
Comment #1
erikwebb CreditAttribution: erikwebb commentedDoes esi_block work for you or is this problem specific to esi_panels.
Comment #2
manarth CreditAttribution: manarth commentedThe URL provided -
http://mylocalsite.co:8080/forums/esi/panels_pane/ibase%3A29%3A279/0/aG9tZQ%3D%3D
- doesn't match the pattern we usually expect for ESI tags…are you running Drupal under a/forums
subdirectory?The pastebin for
esi_block__recv
shows that the VCL is still expecting the URL to start/esi/
rather than/forums/esi/
- if you're running under a subdirectory, you'll probably need to alter the URL patterns in the VCL.Comment #3
erikwebb CreditAttribution: erikwebb commentedComment #3.0
erikwebb CreditAttribution: erikwebb commentedadding which esi modules im using