Hello,

Here is the steps to reproduce this bug :

1° Create a domain
2° Add a node as frontpage in : /admin/config/domain/domain_site_settings/your_domain/edit
3° Add {% if is_front %}This is the frontpage{% else %}This is NOT frontpage{% endif %} to your page.html.twig
4° Go to your new frontpage
5° It displays : This is NOT frontpage.

Thanks.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Mistrae created an issue. See original summary.

mistrae’s picture

Ok I just find out this is a cache problem.

Once you cached a frontpage, this become the frontpage from every domain.

mistrae’s picture

Adding : 'url.site' in the required_cache_contexts and contexts of services.yml seems to fix this issue.

jacobbell84’s picture

Version: 8.x-1.2 » 8.x-1.x-dev
Related issues: +#2881447: Front Page caching prevents redirect
StatusFileSize
new580 bytes

We're running into some cache related issues on our side as well. Hopefully this fixes all of them. I copied the approach other ConfigOverride classes use, which is setting the cache contexts in the getCacheableMetadata function. Not sure if it matters or not, I couldn't find any documentation on the differences.

jacobbell84’s picture

Status: Active » Needs review
jacobbell84’s picture

abhaisasidharan made their first commit to this issue’s fork.