Skip to content

Removed test code #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/varnish-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ User Context

Feature: :doc:`user context hashing <user-context>`

Subroutines are provided in ``resources/config/varnish-[version]/fos_user_context.vcl``.
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.


To enable support add the following to ``your_varnish.vcl``:


Expand All @@ -211,6 +213,7 @@ To enable support add the following to ``your_varnish.vcl``:
.. code-block:: varnish4

include "path-to-config/varnish-4/fos_user_context.vcl";
include "path-to-config/varnish-4/fos_user_context_url.vcl";

sub vcl_recv {
call fos_user_context_recv;
Expand All @@ -227,6 +230,7 @@ To enable support add the following to ``your_varnish.vcl``:
.. code-block:: varnish3

include "path-to-config/varnish-3/fos_user_context.vcl";
include "path-to-config/varnish-4/fos_user_context_url.vcl";

sub vcl_recv {
call fos_user_context_recv;
Expand Down
4 changes: 1 addition & 3 deletions resources/config/varnish-3/fos_user_context.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ sub fos_user_context_recv {

# Backup original URL
set req.http.X-Fos-Original-Url = req.url;
set req.url = "/_fos_user_context_hash";

# For functional tests

call user_context_hash_url;

# Force the lookup, the backend must tell not to cache or vary on all
Expand Down
12 changes: 12 additions & 0 deletions resources/config/varnish-3/fos_user_context_url.vcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is part of the FOSHttpCache package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

sub user_context_hash_url {
set req.url = "/_fos_user_context_hash";
}
4 changes: 1 addition & 3 deletions resources/config/varnish-4/fos_user_context.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ sub fos_user_context_recv {

# Backup original URL
set req.http.X-Fos-Original-Url = req.url;
set req.url = "/_fos_user_context_hash";

# For functional tests

call user_context_hash_url;

# Force the lookup, the backend must tell not to cache or vary on all
Expand Down
12 changes: 12 additions & 0 deletions resources/config/varnish-4/fos_user_context_url.vcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is part of the FOSHttpCache package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

sub user_context_hash_url {
set req.url = "/_fos_user_context_hash";
}