Skip to content

Commit

Permalink
Merge branch 'hhamon-varnish_fix' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Aug 23, 2011
2 parents 2fbdbb5 + 3618472 commit f1586e6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cookbook/cache/varnish.rst
Expand Up @@ -47,15 +47,19 @@ Symfony2 adds automatically:
sub vcl_fetch {
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
unset beresp.http.Surrogate-Control;
esi;
// for Varnish >= 3.0
set beresp.do_esi = true;
// for Varnish < 3.0
// esi;
}
}
.. caution::

Don't use compression with ESI as Varnish won't be able to parse the
response content. If you want to use compression, put a web server in
front of Varnish to do the job.
Compression with ESI was not supported in Varnish until version 3.0
(read `GZIP and Varnish`_). If you're not using Varnish 3.0, put a web
server in front of Varnish to perform the compression.

.. index::
single: Varnish; Invalidation
Expand Down Expand Up @@ -89,4 +93,5 @@ that will invalidate the cache for a given resource:
You must protect the ``PURGE`` HTTP method somehow to avoid random people
purging your cached data.

.. _`Edge Architecture`: http://www.w3.org/TR/edge-arch
.. _`Edge Architecture`: http://www.w3.org/TR/edge-arch
.. _`GZIP and Varnish`: https://www.varnish-cache.org/docs/3.0/phk/gzip.html

0 comments on commit f1586e6

Please sign in to comment.