Skip to content

Commit c6f8e11

Browse files
committed
Minor tweaks
1 parent f3e4a03 commit c6f8e11

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

http_cache/varnish.rst

+12-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,18 @@ at least for some parts of the site, e.g. when using forms with
6767
and clear the session when it is no longer needed. Alternatively, you can look
6868
into :ref:`caching pages that contain CSRF protected forms <caching-pages-that-contain-csrf-protected-forms>`.
6969

70-
Cookies created in JavaScript and used only in the frontend, e.g. when using
71-
Google Analytics, are nonetheless sent to the server. These cookies are not
72-
relevant for the backend and should not affect the caching decision. Configure
73-
your Varnish cache to `clean the cookies header`_. The goal is to retain only essential cookies—such as session cookies—and remove all others. By doing this, pages can still be cached when there is no active session. If you are using PHP and have not changed its default configuration, the session cookie is typically named PHPSESSID. Additionally, if your application relies on other important cookies, such as a "REMEMBERME" cookie for "remember me" functionality or "trusted_device" for 2FA, these cookies should also be preserved.
70+
Cookies created in JavaScript and used only on the frontend, such as those from
71+
Google Analytics, are still sent to the server. These cookies are not relevant
72+
for backend processing and should not influence the caching logic. To ensure
73+
this, configure your Varnish cache to `clean the cookies header`_ by retaining
74+
only essential cookies (e.g., session cookies) and removing all others. This
75+
allows pages to be cached when there is no active session.
76+
77+
If you are using PHP with its default configuration, the session cookie is
78+
typically named ``PHPSESSID``. Additionally, if your application depends on other
79+
critical cookies, such as a ``REMEMBERME`` cookie for :doc:`remember me </security/remember_me>`
80+
functionality or a trusted device cookie for two-factor authentication, these
81+
cookies should also be preserved.
7482

7583
.. configuration-block::
7684

0 commit comments

Comments
 (0)