-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Full page caching issue on multisite #4556
Comments
Tracking internally - MAGETWO-53126 |
@nobuttsalex We cannot reproduce this issue. It will be helpful if you can provide more information, such as Built-in cache vs. Varnish, how do you configure your two website, etc. Thanks. |
Also, what kind of server is used? |
Ubuntu 15.10 Configured two websites with 1 store and 1 store view in each using these instructions http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_apache.html Have not setup varnish, but my env.php file looks like this:
|
Thank you for the info. There are a few options in that doc you supplied. Are you separating your two sites by different domains, or different paths on the same domain? And are you setting the run type and run code variables in different entry points, or in htaccess? |
The two sites are on the same domain but different subdomains. And I have this code at the bottom of index.php
|
So I still need to try to reproduce this using the same multisite technique you're using, but one observation: you're only setting PARAM_RUN_TYPE to 'website' if your secondary website is used - otherwise the var isn't set so default run type value will be 'store.' I'm not positive right now whether we support that (having different run types per website), I'll dig into that - but in the meantime, if you try setting run type to website outside of the condition, does that resolve your immediate issue? |
But even using that method I don't reproduce. The puzzler is that the two websites should be differentiated in the cache by their store view codes, which should be different. Could you please add this line: To the beginning of |
First website: Second website: |
It appears as though the second website is using the same store view as the first. Can you double check that you have a separate store view and separate store for the second website? For instance, my log output for 2nd website is: |
Each has it's own website, store and store view. They also have different themes and different categories/products and with full page cache disabled everything works as it should. I'm now on 2.1.0-rc1. In earlier versions on the dev branch my setup worked perfectly with full page cache enabled. |
Something I'll point out which may help replicate the problem is new sessions are more likely to load the wrong homepage. If a session has seen the correct homepage it will continue to however many times you refresh but if you were to clear your cookies you would probably get the wrong one again. |
Ok, I was able to reproduce the problem. We'll look into it. |
Hello @nobuttsalex, this issue has been fixed in the 2.1.0 Release, that's why I'm closing it. If you any questions or additional information regarding the issue feel free to reopen it or create a new one. |
I think I'm having this or a very similar issue on Magento 2.1.0. We show a different store and theme based on the client's user agent. We set the store in pub/index.php according to the user agent, and then configure different themes for those stores. Now when I turn on the built-in full page cache, the first page visit seems to determine the theme that I will see. So if I use Firefox with one user agent, it loads theme A, but then when I load the store in Chrome with Device Mode for a mobile user agent, I will still see theme A, but I expect to see theme B. After clearing the cache, the correct theme is loaded only on the first load. When I disable full page cache, the correct one is loaded every time. |
This issue is happening again in the version 2.1.11, everything was ok until the version 2.1.10, when we update to 2.1.11, my multiple sites are not loading correctly when the full_page cache is enabled, is always loading the default store |
If you force the cookie store to the correct storeviewcode it will load right the second request the first one always load the default store, even if you create the cookie on the index before all the magento magic happens |
we have the same issue as alevelo mentioned, how can we solve it? and our version is 2.2.7 Thank you |
@hanxiangwu check if this PR works: #18624 |
[Owls] MC-18009: Disabled Products Do Not Appear in Search Results of Link Attribute
Steps to reproduce
Most up-to-date version of the dev branch.
There seems to be crossover in the full page cache of different websites. This only started being an issue yesterday or today so I guess it was a very recent change.
Disabling full page caching fixes the issue but obviously only a temporary solution.
Expected result
Website 1 to show Homepage 1 and Website 2 to show Homepage 2
Actual result
Both Website 1 and 2 show Homepage 1
The text was updated successfully, but these errors were encountered: