filter · Image filters
In-place browser optimization (in_place_optimize_for_browser)
- Category:
- Image
- CoreFilters:
- No
- OptimizeForBandwidth:
- No
- Risk:
- Not rated
in_place_optimize_for_browser is retired. It used to vary in-place optimized images by the browser’s Accept header and add Vary: Accept; in-place optimization no longer produces browser-dependent bytes, so the filter has nothing left to do. The name is still accepted, with a warning, so an existing configuration keeps loading; it is no longer part of OptimizeForBandwidth.
How it works
Remove it from your configuration.
When to use it
- Not in CoreFilters: it runs only when you enable it by name.
- Retired: the name is still accepted (with a warning) but has no effect, because in-place optimization no longer varies its output by browser.
Risks
-
The
Vary: Acceptheader can reduce CDN cache hit rates. Many CDNs handleVarycorrectly, but verify with your provider. -
Some proxy servers do not respect
Varyheaders and may serve the wrong format to clients.
Configuration
Enable it in the module configuration, at server, virtual-host or location scope:
Apache
ModPagespeedEnableFilters in_place_optimize_for_browsernginx
pagespeed EnableFilters in_place_optimize_for_browser;IIS (pagespeed.config)
pagespeed EnableFilters in_place_optimize_for_browser
Scoping, ForbidFilters and the thresholds filters read:
Choosing filters
.
Frequently asked questions
- What does the in_place_optimize_for_browser filter do?
in_place_optimize_for_browseris retired. It used to vary in-place optimized images by the browser'sAcceptheader and addVary: Accept; in-place optimization no longer produces browser-dependent bytes, so the filter has nothing left to do. The name is still accepted, with a warning, so an existing configuration keeps loading; it is no longer part ofOptimizeForBandwidth.- Is in_place_optimize_for_browser enabled by default?
- No.
in_place_optimize_for_browseris not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable in_place_optimize_for_browser on Apache and nginx?
- Add
ModPagespeedEnableFilters in_place_optimize_for_browseron Apache orpagespeed EnableFilters in_place_optimize_for_browser;on nginx. On IIS, addpagespeed EnableFilters in_place_optimize_for_browserto 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 in_place_optimize_for_browser entry on Image filters. Every filter in one table: PageSpeed filters.