diff --git a/doc/cache-invalidator.rst b/doc/cache-invalidator.rst index e4e83d14..aa3763d5 100644 --- a/doc/cache-invalidator.rst +++ b/doc/cache-invalidator.rst @@ -43,6 +43,15 @@ See below for the :ref:`flush() ` method. Invalidate a URL:: $cacheInvalidator->invalidatePath('http://www.example.com/users')->flush(); + +Invalidate a URL with added header(s):: + + $cacheInvalidator->invalidatePath( + 'http://www.example.com/users', + array('Cookie' => 'foo=bar; fizz=bang') + )->flush(); + +.. include:: includes/custom-headers.rst Refreshing Paths and URLs ------------------------- @@ -60,6 +69,15 @@ Refresh a URL:: $cacheInvalidator->refreshPath('http://www.example.com/users')->flush(); +Refresh a URL with added header(s):: + + $cacheInvalidator->refreshPath( + 'http://www.example.com/users', + array('Cookie' => 'foo=bar; fizz=bang') + )->flush(); + +.. include:: includes/custom-headers.rst + .. _invalidate regex: Invalidating With a Regular Expression diff --git a/doc/includes/custom-headers.rst b/doc/includes/custom-headers.rst new file mode 100644 index 00000000..bfd31bb6 --- /dev/null +++ b/doc/includes/custom-headers.rst @@ -0,0 +1,3 @@ +This allows you to pass headers that are different between purge requests. +If you want to add a header to all purge requests, such as ``Authorization``, +use a :ref:`custom Guzzle client ` instead. diff --git a/doc/proxy-clients.rst b/doc/proxy-clients.rst index b1ec47bd..f05ee39c 100644 --- a/doc/proxy-clients.rst +++ b/doc/proxy-clients.rst @@ -114,9 +114,7 @@ For instance:: Please note that purge will invalidate all variants, so you do not have to send any headers that you vary on, such as ``Accept``. -The above allows you to pass headers that are different between purge requests. -If you want to send headers for all purge requests, such as ``Authorization``, -use a :ref:`custom Guzzle client ` instead. +.. include:: includes/custom-headers.rst Refresh ~~~~~~~