?
avatar Handy84
Handy84
16 Jul 2016

Steps to reproduce the issue

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)

Expected result

A switch back to the default language.

Actual result

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.

System information (as much as possible)

Joomla 3.6.0
php version 7.0.8
I am using browsercaching by ExpiresByType.
The domain: http://www.handysplace.nl

Additional comments

In my case I have default language Dutch and another language English.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar Handy84 Handy84 - open - 16 Jul 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Jul 2016

same as #11143 ?

avatar Handy84
Handy84 - comment - 16 Jul 2016

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11159.

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Jul 2016

the problem is the cached 301 redirect right?

avatar ggppdk
ggppdk - comment - 16 Jul 2016

Same reason,

  • but this time more problematic effect, issue #11143 is rather minor
  • language switching of home-page, is impossible if you enable "Remove URL Language Code", which removes language code for default language

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

  • thus it is not urgent, but really needs to be fixed
  • the bad is that as time passes more websites are telling browsers to cache the home page redirect permanently (if website has enabled "Remove URL Language Code")

to see the effect look at the picture

you visit /nl/
it is redirected permanently to /
which then redirects permanently to /en/

redirect2

redirect3

avatar ggppdk
ggppdk - comment - 16 Jul 2016

@Handy84
Please, see my above description and check the parameter,

Please note that after disabling the parameter,
the effect will not go away
unless you force the browser to clear its cache

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Jul 2016

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();
avatar Handy84
Handy84 - comment - 16 Jul 2016

I have implemented those lines and it's working, big thumbs up !

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Jul 2016

please test #11161

avatar infograf768 infograf768 - change - 17 Jul 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-07-17 06:42:16
Closed_By infograf768
avatar joomla-cms-bot joomla-cms-bot - close - 17 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 17 Jul 2016
avatar infograf768
infograf768 - comment - 17 Jul 2016
avatar infograf768
infograf768 - comment - 17 Jul 2016
avatar simbus82
simbus82 - comment - 31 Oct 2016

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

avatar andrepereiradasilva
andrepereiradasilva - comment - 31 Oct 2016

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.

avatar simbus82
simbus82 - comment - 31 Oct 2016

You are right, this is an old setup not valid with Joomla. Thanks!

Add a Comment

Login with GitHub to post a comment