Setup a multilanguage Joomla 3.6.0 site with 2 languages
1. Switch with the language module from the default language to the other language.
2. Switch back to the default language.
3. Switch again to the other language. (this triggers something in the cached browser files)
4. Try to select the default language. (my screen flashes but nothing is happening)
A switch back to the default language.
Now you are stuck in the last choosen language, unless you clear your browser cache.
I detected this bahaviour on different Joomla sites I created. Which formerly works correct (before the update to Joomla 3.6.0)
Tested this in IE Chrome and Firefox.
Joomla 3.6.0
php version 7.0.8
I am using browsercaching by ExpiresByType.
The domain: http://www.handysplace.nl
In my case I have default language Dutch and another language English.
I claim this is not the same issue as #11143 because after I switched twice to English I can't visit my dutch home page anymore unless I first clear the browser cache!
Visits from my browser will always go to the http://www.handysplace/en language even if I visit http://www.handysplace.nl/nl it will rewrite to /en.
the problem is the cached 301 redirect right?
Same reason,
at least if you are at a non-home page url the language switching will work,
so in great majority of web-sites, users will be able to switch language
to see the effect look at the picture
you visit /nl/
it is redirected permanently to /
which then redirects permanently to /en/
i think there are two options:
1. Send HTTP header to remove browser cache from 301 redirect
2. Use a 302 or 303 redirect (doesn't cache) but less SEO
Anyway the changes are in here https://github.com/joomla/joomla-cms/blob/staging/plugins/system/languagefilter/languagefilter.php#L397-L402
For 301 with no cache i think prepending this lines would work
$this->app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$this->app->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT');
$this->app->sendHeaders();
I have implemented those lines and it's working, big thumbs up !
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-17 06:42:16 |
Closed_By | ⇒ | infograf768 |
Closed as we have a patch . https://issues.joomla.org/tracker/joomla-cms/11161
Set to "closed" on behalf of @infograf768 by The JTracker Application at issues.joomla.org/joomla-cms/11159
I have the same problem with Joomla 3.6.4, but i have a modified htaccess with:
# EXPIRES CACHING #
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 2 days" <------ AFTER REMOVE IT, PROBLEM SOLVED.
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType text/js "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
</IfModule>
If i remove "ExpiresDefault "access plus 2 days"" the problem is solved.
How can i be more specific with expires without breaking the multilanguage cache control?
Thanks
if you are caching all html pages in browser for 2 days you will have issues more problematic than this.
Anyway you can't change the joomla cache http headers for 301/302/303 redirects with your webserver for the language filter to work fine.
You are right, this is an old setup not valid with Joomla. Thanks!
same as #11143 ?