-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page cache key doesn't depend on language #6607
Labels
Comments
sephii
changed the title
Page cache doesn't depend on language
Page cache key doesn't depend on language
Feb 2, 2019
I made a fix here. I'd be happy to submit it as a PR but I guess I should write a test first. I'll do it when I have more time. |
viktor-yunenko
added
status: accepted
status: has patch
kind: bug
and removed
status: accepted
labels
Oct 29, 2021
Hi @sephii, that sounds great, thank you! And sure please feel free to submit a PR 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Resolved by #7354 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
The docs for the
CMS_PAGE_CACHE
setting mention that the language is used to build the cache key:The
_page_cache_key
function relies onrequest.get_full_path()
to add the language to the cache key. However there are cases where the language is not in the path. For example you could create your own middleware that sets the language depending on the hostname, instead of the path (which is my case).I think just adding
translation.get_language()
to the key would do the trick without any side effect.Expected behaviour
The cache includes the current active language instead of relying of the language being in the URL.
Actual behaviour
The cache relies on the language being part of the URL.
Environment
The text was updated successfully, but these errors were encountered: