Using ESI-tags inside a cached object

Hugo Cisneiros (Eitch) hugo.cisneiros at gmail.com
Tue Jul 10 19:34:16 CEST 2012


On Mon, Jul 9, 2012 at 11:51 AM, Kasper Grubbe <kaspergrubbe at gmail.com> wrote:
> I am following the guide here:
> https://www.varnish-cache.org/docs/trunk/tutorial/esi.html
>
> I have two pages in my project as of now:
>
> 1. http://127.0.0.1:3001/ (Cache-Control:max-age=60, private):
> <b>Cached:</b> <%= Time.now %> <br/>
> <b>ESI:</b> <esi:include src="/staticview" /> <br/>
>
> 2. http://127.0.0.1:3001/staticview (Cache-Control:max-age=1, private):
> <%= Time.now %>
>
> However, every time I request the first page, it seems like it also
> caches the ESI-include result for the 60 seconds instead of refreshing
> every second.

I think it is expected, as you're caching the ESI page too. When
varnish finds an ESI tag, it gets the page as a internal new request.
So you must do a pass on the /staticview, and it will be always
dynamic.

-- 
[]'s
Hugo
www.devin.com.br



More information about the varnish-misc mailing list