POST requests to ESIs

James Sansbury james.sansbury at lullabot.com
Wed Jan 12 16:31:23 CET 2011


Hello all!

Consider this scenario: You have a piece of content that has commenting on
it. The comments are highly dynamic, but the content of the page itself is
basically static. ESI works great here to load all the comments with a TTL
of zero.

However, there is a comment form on this page as well. If a comment
submission is made, by default Varnish will pass the POST request through to
the backend. But on a site that is heavily commented, this means loading up
that full page for each POST unnecessarily. The only piece of the page that
has changed is the comment ESI, which could very well accept that POST
request itself and do the processing, thereby lowering the number of
requests to the backend.

I see in the ESI code that it is hard coded that all ESI requests are GET
requests. Some ESI implementations allow you to specify a method in the tag
(e.g., <esi src="foo" method="POST" />). I was thinking it would be handy if
Varnish could support this, or something similar. Some way of parsing a POST
request as it comes in, and possibly routing it to  the ESI that can accept
it. Or maybe even something more abstract than that; a way to further
customize the ESI request in the vcl.

Thoughts?

Thanks for your time!

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110112/11bf939c/attachment-0003.html>


More information about the varnish-misc mailing list