The toolbar middleware triggers Vary: Cookie header on non-toolbar pages #6569
Labels
kind: bug
needs reproduction
This issue might have been fixed during the last years
status: accepted
Summary
The toolbar middleware triggers
Vary: Cookie
header on non-toolbar pages because it checks the session unnecessarily. This breaks caching.Expected behaviour
Do not check session variables if there is no toolbar on the page.
Actual behaviour
The toolbar middleware triggers
Vary: Cookie
HTTP header on non-toolbar pages, which breaks caching. This happens becausecms.middleware.toolbar.ToolbarMiddleware
checks for session variables, which then causes the session middleware to send the Vary: Cookie header.Environment
Possible solutions I can think of:
?edit
is in the path.?edit
is in the path.Vary: Cookie
off of the CMS pages while not in edit mode.cms_toolbar
placeholder.I'm willing and able to write the PR for this. Let's please discuss the preferred solution(s).
The text was updated successfully, but these errors were encountered: