You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In TranslationMiddleware on process_response "set_cookie" is executed on every response - even when proper cookie for specific language is already set. This leads to problem with proxies and caching. If response sets a cookie most standard proxy configuration will prevent this response from being cached (304 Not modfied etc)
How to reproduce?
Open a TranslateableSite with enabled TranslationMiddleware
You'll see "set-cookie: django_language=pl; Path=/"
If a proper check can be implemented for the cookie if the value doesn't change, I don't see any problems with changing this to only set it when the value changes.
Issue summary
In TranslationMiddleware on process_response "set_cookie" is executed on every response - even when proper cookie for specific language is already set. This leads to problem with proxies and caching. If response sets a cookie most standard proxy configuration will prevent this response from being cached (304 Not modfied etc)
How to reproduce?
Technical details
Python version: 3.6.4
Django version: 2.2.6
Wagtail version: 2.6.3
Wagtaltrans version: 2.0.6
The text was updated successfully, but these errors were encountered: