[WEB-8784] Enforce max image width via Fastly IO params in img shortcode#35926
Open
nsollecito wants to merge 3 commits intomasterfrom
Open
[WEB-8784] Enforce max image width via Fastly IO params in img shortcode#35926nsollecito wants to merge 3 commits intomasterfrom
nsollecito wants to merge 3 commits intomasterfrom
Conversation
…tcode - Add &fit=max to Fastly IO URL to prevent upscaling images smaller than the width cap - Add $e2x with &dpr=2 for retina displays, applied to all srcset attributes as "1x, 2x" descriptors - Consolidate triple $e definition into a single assignment; remove redundant inner re-assignments in wide and standard branches Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Strip ?ch=Width,DPR and ?ch=Width,Save-Data from all Fastly IO URLs — these were Imgix-specific client hint params not used by Fastly IO. Also rename the imgix config key to img for CDN-agnostic naming. Files updated: img.html shortcode, img.html partial, left-nav.html, platforms.html, vimeo.html, tile-nav.html, config/_default/params.yaml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do? What is the motivation?
Fixes WEB-8784: https://datadoghq.atlassian.net/browse/WEB-8784
The
img.htmlshortcode computed a max display width ($img_w: 850px standard, 1170px wide) but never applied it to the Fastly IO image URL. Every image was served at full resolution via?auto=formatonly, regardless of actual display size.This change appends
&w=$img_wto the Fastly IO URL in all three$eassignment branches, capping image downloads to the content column constraints. Also renames$imgix_w→$img_wfor CDN-agnostic naming.Noticeable difference in larger-asset sizes. Validate downloaded file sizes on the /logs page compared with live: https://docs-staging.datadoghq.com/nsollecito/img-max-width/logs/
Merge instructions
Merge readiness:
Additional notes
Content column is
col-lg-7of a 1170px container (~682px rendered width). The 850px cap for standard images provides ~1.25x retina headroom; 1170px for wide images matches the full container width.