11Caching Proxy Clients
22=====================
33
4- This library ships with clients for the Varnish and NGINX caching proxy . You
4+ This library ships with clients for the Varnish, NGINX and Symfony built-in caching proxies . You
55can use the clients either wrapped by the :doc: `cache invalidator <cache-invalidator >`
66(recommended), or directly for low-level access to invalidation functionality.
77
@@ -35,16 +35,16 @@ include that port in the base URL::
3535
3636.. note ::
3737
38- To use the client , you need to :doc: `configure Varnish <varnish-configuration >` accordingly.
38+ To make invalidation work , you need to :doc: `configure Varnish <varnish-configuration >` accordingly.
3939
4040NGINX Client
4141~~~~~~~~~~~~
4242
4343At minimum, supply an array containing IPs or hostnames of the NGINX servers
4444that you want to send invalidation requests to. Make sure to include the port
45- NGINX runs on if it is not port 80 ::
45+ NGINX runs on if it is not the default ::
4646
47- use FOS\HttpCache\Invalidation \Nginx;
47+ use FOS\HttpCache\ProxyClient \Nginx;
4848
4949 $servers = array('10.0.0.1', '10.0.0.2:8088'); // Port 80 assumed for 10.0.0.1
5050 $nginx = new Nginx($servers);
@@ -64,6 +64,29 @@ supply that location to the class as the third parameter::
6464
6565 To use the client, you need to :doc: `configure NGINX <nginx-configuration >` accordingly.
6666
67+ Symfony Client
68+ ~~~~~~~~~~~~~~
69+
70+ At minimum, supply an array containing IPs or hostnames of your web servers
71+ running Symfony. Provide the direct access to the web server without any other
72+ proxies that might block invalidation requests. Make sure to include the port
73+ the web server runs on if it is not the default::
74+
75+ use FOS\HttpCache\ProxyClient\Symfony;
76+
77+ $servers = array('10.0.0.1', '10.0.0.2:8088'); // Port 80 assumed for 10.0.0.1
78+ $client = new Symfony($servers);
79+
80+ This is sufficient for invalidating absolute URLs. If you also wish to
81+ invalidate relative paths, supply the hostname (or base URL) where your website
82+ is available as the second parameter::
83+
84+ $client = new Symfony($servers, 'my-cool-app.com');
85+
86+ .. note ::
87+
88+ To make invalidation work, you need to :doc: `use the EventDispatchingHttpCache <symfony-cache-configuration >`.
89+
6790Using the Clients
6891-----------------
6992
@@ -200,4 +223,7 @@ send a basic authentication header, you can inject a custom Guzzle client::
200223 $servers = array('10.0.0.1');
201224 $varnish = new Varnish($servers, '/baseUrl', $client);
202225
226+ The Symfony client accepts a guzzle client as the 3rd parameter as well, NGINX
227+ accepts it as 4th parameter.
228+
203229.. _Guzzle client : http://guzzle3.readthedocs.org/
0 commit comments