Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello my tests seems that authcache does not support multilingual pages? Is there a possibility to add the language as a differentiation of the cache? I can't use the path prefix so the path is the same.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2333605-authcache-builtin-multilingual-8.patch | 7.58 KB | znerol |
#5 | 2333605-authcache-builtin-multilingual.patch | 1.89 KB | znerol |
#4 | Screenshot from 2014-09-06 21:58:55.png | 78.77 KB | znerol |
Comments
Comment #1
fox_01 CreditAttribution: fox_01 commentedNow i found a hook and added this
This adds an language property but there is a problem. So i tried switching to a language subdomain to ensure the base path is different for each language. This does seem to have a bug
I visit a de page (http://de.domain.de) and it gets written to the cache. So far so good. But if i now switch the base_root to en (http://en.domain.de) then the language is switched on non cached pages but if i visit a cached page that was earlier cache under different language (in this case de) then the de language will show up. The debug shows me this for a visit on the en page:
The lang property is not change so authcache think i am de but the base_root was detected and so the key should be different and presented another cache version and not the de version.
I really need help here
Comment #2
znerol CreditAttribution: znerol commentedThere is a cache-bin (
cache_authcache_key
) which is used to maintain the mapping from the session-id to the authcache-key. I suspect that this cache is not updated when switching the language.In order to verify whether this is the case, please do the following:
cache_authcache_key
cache bin (e.g.drush ev 'cache_clear_all("*", "cache_authcache_key", TRUE);'
In order to solve the issue, try to figure out whether you can implement language-switching using post-requests or exclude the language-switching links from authcache using cache-rules.
Comment #3
fox_01 CreditAttribution: fox_01 commentedThanks for your response.
First i cleared all caches. Then i've done the preparation you advice but even at this step i see the problem. I've started with en and primed this page. After that i opened a new private window with another user and another language. I visit the same page (only difference is the active language and the base_root url) and i get the en version presented from the cache.
I've also tried it with other languages.
I've also tried to remove the additional "lang" key because i think the different subdomain for each language should be enough but this is the same behaviour. Why is the cache delivered from the from language even if the base_root url is different. My understanding is that all the key properties together + the page arguments have to be the same to get a cache hit.
Comment #4
znerol CreditAttribution: znerol commentedOk, I'm trying to figure out what is going wrong on a test-setup. The first thing jumping into my mind is Language detection and selection (
admin/config/regional/language/configure
). Please deselect all detection methods except URL. Especially the User method seems to interfere with authcache in my case.Comment #5
znerol CreditAttribution: znerol commentedOk, I see it is indeed the key-cache of the Authcache Builtin Storage Backend. Lets include the base-root in the cache id. Patch attached.
Comment #7
fox_01 CreditAttribution: fox_01 commentedThe patch seems to work for now. I will give you more information about my tests later
Comment #8
znerol CreditAttribution: znerol commentedThis patch includes fixes for the automated test code, no functional changes.
Comment #10
znerol CreditAttribution: znerol commentedThanks for the report, fixed in dev, will be part of the next release.
Comment #12
joro78 CreditAttribution: joro78 commentedWe have a similar situation with a site with Drupal7. The main language is Bulgarian. When browsing the site as not authenticated user or registering in Bulgarian (the primary system language) the site works fast enough. The problem emerges when switching on English and authenticating the user. The speed after user login when requesting a page degrades significantly. Is there some way to improve the speed or patch the module in order to have similar results as in the main language?
Comment #13
znerol CreditAttribution: znerol commentedPlease do not comment on closed issues. Instead open a new support request.