Skip to content

Commit 1fa011d

Browse files
authored
Merge pull request #364 from FriendsOfSymfony/Toflar
Added a note about the replay-headers-bundle
2 parents e1bdfc0 + d8de84e commit 1fa011d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Resources/doc/features/user-context.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ These five steps resemble the Overview in the FOSHttpCache documentation.
3737
sets a ``Vary: X-User-Context-Hash`` header. The appropriate user context
3838
dependent representation of ``/foo`` will then be returned to the client.
3939

40+
.. note::
41+
42+
In other words we execute a preflight request here. A preflight request is
43+
a request that is sent prior to the real request. See for example how
44+
`CORS requests`_ work. The result of the preflight request is the
45+
``X-User-Context-Hash`` header that is added to the real request.
46+
47+
This concept can be generalized to handle more than the user context
48+
scenario. The `terminal42/header-replay-bundle`_ builds on top of the
49+
``FOSHttpCacheBundle`` to add support for more complicated use cases. Have
50+
a look at the `HeaderReplayBundle documentation`_ if the user context is
51+
not flexible enough for your needs.
52+
   
4053
Configuration
4154
-------------
4255

@@ -111,3 +124,7 @@ Caching Hash Responses
111124

112125
To improve User Context Caching performance, you should cache the hash responses.
113126
You can do so by configuring :ref:`hash_cache_ttl`.
127+
128+
.. _CORS requests: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
129+
.. _terminal42/header-replay-bundle: https://github.com/terminal42/header-replay-bundle
130+
.. _HeaderReplayBundle documentation: https://github.com/terminal42/header-replay-bundle#terminal42header-replay-bundle

Resources/doc/spelling_word_list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ multi
1818
login
1919
logout
2020
Packagist
21+
preflight

0 commit comments

Comments
 (0)