You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ``fos_user_context.vcl`` needs the ``user_context_hash_url`` subroutine that sets a URL to the request lookup URL. The default URL is ``/_fos_user_context_hash`` and you can simply include ``resources/config/varnish-[version]/fos_user_context_url.vcl`` in your configuration to provide this. If you need a different URL, include a custom file implementing the ``user_context_hash_url`` subroutine.
205
+
The ``fos_user_context.vcl`` needs the ``user_context_hash_url`` subroutine
206
+
that sets the URL to do the hash lookup. The default URL is
207
+
``/_fos_user_context_hash`` and you can simply include
208
+
``resources/config/varnish-[version]/fos_user_context_url.vcl`` in your
209
+
configuration to provide this. If you need a different URL, write your own
210
+
``user_context_hash_url`` subroutine instead.
206
211
212
+
.. tip::
213
+
214
+
The provided VCL to fetch the user hash restarts GET/HEAD requests. It
215
+
would be more efficient to do the hash lookup request with curl, using the
216
+
`curl Varnish plugin`_. If you can enable curl support, the recommended way
217
+
is to implement your own VCL to do a curl request for the hash lookup
218
+
instead of using the VCL provided here.
207
219
208
-
To enable support add the following to ``your_varnish.vcl``:
220
+
Also note that restarting a GET request leads to Varnish discarding the
221
+
body of the request. If you have some special case where you have GET
222
+
requests with a body, use curl.
209
223
224
+
To enable this feature, add the following to ``your_varnish.vcl``:
210
225
211
226
.. configuration-block::
212
227
@@ -262,13 +277,6 @@ To enable support add the following to ``your_varnish.vcl``:
262
277
Your backend application needs to respond to the ``application/vnd.fos.user-context-hash``
263
278
request with :ref:`a proper user hash <return context hash>`.
264
279
265
-
.. note::
266
-
267
-
We do not use ``X-Original-Url`` here, as the header will be sent to the
268
-
backend and the header has semantical meaning for some applications, which
269
-
would lead to problems. For example, the Microsoft IIS rewriting module
270
-
uses it, and consequently Symfony also looks into it to support IIS.
271
-
272
280
.. tip::
273
281
274
282
The provided VCL assumes that you want the context hash to be cached, so we
@@ -358,7 +366,7 @@ sends an ``X-Cache-Debug`` header:
358
366
359
367
Subroutines are provided in ``fos_debug.vcl``.
360
368
361
-
To enable support add the following to ``your_varnish.vcl``:
369
+
To enable this feature, add the following to ``your_varnish.vcl``:
362
370
363
371
.. configuration-block::
364
372
@@ -388,5 +396,6 @@ To enable support add the following to ``your_varnish.vcl``:
388
396
.. _banning for Varnish 3: https://www.varnish-software.com/book/3/Cache_invalidation.html#banning
0 commit comments