filter · Image filters
Responsive images zoom (responsive_images_zoom)
- Category:
- Image
- CoreFilters:
- No
- OptimizeForBandwidth:
- No
- Risk:
- Not rated
responsive_images_zoom adds a small script next to the srcset attributes that responsive_images generates, so that when the visitor zooms the page the browser picks a variant that stays sharp at the zoomed size instead of upscaling the one chosen for the original zoom level. Enable it together with responsive_images; on its own it does nothing. Not a core filter; test it with your image markup first.
When to use it
- Not in CoreFilters: it runs only when you enable it by name.
Risks
-
Adds a script to every page with responsive images.
-
Extra variants are fetched on zoom, which costs bandwidth on pages visitors zoom often.
Configuration
Enable it in the module configuration, at server, virtual-host or location scope:
Apache
ModPagespeedEnableFilters responsive_images_zoomnginx
pagespeed EnableFilters responsive_images_zoom;IIS (pagespeed.config)
pagespeed EnableFilters responsive_images_zoomModPagespeedEnableFilters responsive_images,responsive_images_zoompagespeed EnableFilters responsive_images,responsive_images_zoom;
Scoping, ForbidFilters and the thresholds filters read:
Choosing filters
.
Frequently asked questions
- What does the responsive_images_zoom filter do?
responsive_images_zoomadds a small script next to thesrcsetattributes thatresponsive_imagesgenerates, so that when the visitor zooms the page the browser picks a variant that stays sharp at the zoomed size instead of upscaling the one chosen for the original zoom level. Enable it together withresponsive_images; on its own it does nothing. Not a core filter; test it with your image markup first.- Is responsive_images_zoom enabled by default?
- No.
responsive_images_zoomis not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable responsive_images_zoom on Apache and nginx?
- Add
ModPagespeedEnableFilters responsive_images_zoomon Apache orpagespeed EnableFilters responsive_images_zoom;on nginx. On IIS, addpagespeed EnableFilters responsive_images_zoomto pagespeed.config.
Related filters
- convert_gif_to_png — Convert GIF to PNG
- convert_jpeg_to_avif — Convert JPEG to AVIF
- convert_jpeg_to_progressive — Progressive JPEG
- convert_jpeg_to_webp — Convert JPEG to WebP
- convert_png_to_jpeg — Convert PNG to JPEG
- convert_to_avif_animated — Animated AVIF
- convert_to_avif_lossless — Lossless AVIF
- convert_to_webp_animated — Animated WebP
This page is drawn from the responsive_images_zoom entry on Image filters. Every filter in one table: PageSpeed filters.