Skip to main content

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_zoom

nginx

pagespeed EnableFilters responsive_images_zoom;

IIS (pagespeed.config)

pagespeed EnableFilters responsive_images_zoom
ModPagespeedEnableFilters responsive_images,responsive_images_zoom
pagespeed 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_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.
Is responsive_images_zoom enabled by default?
No. responsive_images_zoom is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable responsive_images_zoom on Apache and nginx?
Add ModPagespeedEnableFilters responsive_images_zoom on Apache or pagespeed EnableFilters responsive_images_zoom; on nginx. On IIS, add pagespeed EnableFilters responsive_images_zoom to pagespeed.config.

This page is drawn from the responsive_images_zoom entry on Image filters. Every filter in one table: PageSpeed filters.

Search