Problem/Motivation

URLs to image files are cached including the domain. In a multidomain environment, this causes unnecessary redirects, that can also fail if SSL is enabled on one domain and not the other.

Proposed resolution

The Problem could probably be resolved by serving the picture source sets as root-relative paths (e.g. /some/path/image.png) instead of absolute URLs (e.g. https://cached-domain.com/some/path/image.png). The source of the problem is located in the pagedesigner_responsive_images module, where the twig extension function styled_image_url() which is being called from the responsive-image.html.twig in the iq_barrio theme returns a absolute URL in the getStyledImageUrl() function in ResponsiveImageStylesTwigExtension.php.

There is a core issue on the topic of ImageStyle::buildUrl() returning absolute URLs instead of root-relative paths here. And in there is also a solution: you could call file_url_transform_relative() on the absolute URL before returning (will be deprecated in D10, see here).

Remaining tasks

User interface changes

API changes

Data model changes

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

pvbergen created an issue. See original summary.

pvbergen’s picture

Issue summary: View changes

pvbergen’s picture

Status: Active » Needs review

pvbergen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.