Skip to main content

build_srcset

Function build_srcset 

Source
pub fn build_srcset(src: &str, quality: u8) -> String
Expand description

srcset’s own value when sizes is set - one entry per [SRCSET_BREAKPOINTS] (capped at MAX_DIMENSION), each an aspect-ratio-preserving width-only variant (see optimized_url’s own height: None case) of the same on-demand route the plain src already uses - nothing here is pre-generated; a given breakpoint is decoded/resized/encoded (and cached) only the first time some visitor’s browser actually requests exactly that width.