Skip to main content

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: Accept header can reduce CDN cache hit rates. Many CDNs handle Vary correctly, but verify with your provider.

  • Some proxy servers do not respect Vary headers 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_browser

nginx

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

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

Search