Links don't vary for single site with multiple hostnames

Created on 28 June 2024, 5 months ago
Updated 1 July 2024, 5 months ago

Problem/Motivation

When a single site has multiple hostnames (e.g. www.example.com and www-cms.example.com), a race condition occurs in which the first hostname served is used for all hostnames. This can cause retrieval of the manifest file to result in a CORS error.

Using the previous example, if the first page load is for www-cms.example.com, then pages loaded from www.example.com will have their favicon links rendered to load from www-cms.example.com

To be clear, the www and www-cms sites are meant to be serving the same content. In my particular use case, www is intended to be accessed by the general public while www-cms is used to edit site content.

Steps to reproduce

  1. Create a single site which responds to both www.example.com and www-cms.example.com
  2. Set up favicons via the `resposive_favicons` modules (the exact settings should not matter).
  3. Clear all caches.
  4. Access the site via www-cms.example.com
  5. Access the site a second time, via www.example.com
  6. View the page source from www.example.com

The favicon links on www.example.com will reflect www-cms.example.com.

Proposed resolution

I believe this can be remedied by setting the cache context to 'url.site'.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024