Open alfonso100 opened 1 month ago
This is apparently not limited to CDNs that are subdomains of the origin domain, as I've got another case where the SRCSET is also not being written to the CDN, but the domain is third-party hosted:
TICKET: https://secure.helpscout.net/conversation/2708093350/512378/ SITE: https://www.ciotalknetwork.com/ CDN: https://eweajxggxf5.exactdn.com/
Before submitting an issue please check that you’ve completed the following steps: yes - Made sure you’re on the latest version yes - Used the search feature to ensure that the bug hasn’t been reported before
Describe the bug When the CDN is a subdomain of the site url, for example cdn.wphangar.com and we inject the OCI markup, the CDN replacement won’t be applied to the imagesrcset images, only to the href image:
CDN setting:
cdn.wphangar.com
LCP entry in the DB:
{"type":"img-srcset","src":"https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-1024x683.jpg","srcset":"https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-1024x683.jpg 1024w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-600x400.jpg 600w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-300x200.jpg 300w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-768x512.jpg 768w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341.jpg 1152w","sizes":"(max-width: 1024px) 100vw, 1024px"}
resulting markup:
<link rel="preload" data-rocket-preload as="image" href="https://cdn.wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-1024x683.jpg" imagesrcset="https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-1024x683.jpg 1024w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-600x400.jpg 600w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-300x200.jpg 300w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341-768x512.jpg 768w, https://wphangar.com/wp-content/uploads/2022/12/e5ec5320-c85f-3612-a79f-68079e82f341.jpg 1152w" imagesizes="(max-width: 1024px) 100vw, 1024px" fetchpriority="high">
To Reproduce Steps to reproduce the behavior:
Expected behavior we should replace all the URLs when the CDN is used
Additional context
Slack thread: https://wp-media.slack.com/archives/C072P5EU5DF/p1725644143674919
Tickets: https://secure.helpscout.net/conversation/2700575552/511133/ https://secure.helpscout.net/conversation/2698303805/510752/
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming