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 make the module’s own in-place path vary images by the browser’s Accept header and add Vary: Accept; that path now optimizes an image identically for every client, 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.

The filter does not control format negotiation at the original URL. When the optimizer worker is attached (DaemonSocketPath and DaemonVolumePath, which the Apache packages built to depend on pagespeed-optimizer set in pagespeed_daemon.conf), in-place images are served from the optimizer’s cache in the format the request’s Accept header selects, with Vary: Accept: WebP for */*, image/* or no Accept header, the original format for a request that names only that format. See Image format and the Accept header for the full rule and how to get the original format for a non-browser client.

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 the module’s own in-place path optimizes an image identically for every client. It does not control format negotiation: with the optimizer worker attached, in-place images are still served in the format the request’s Accept header selects, with Vary: Accept.

Risks

  • None from the filter itself: it has no effect. The Vary: Accept considerations for images served from the worker’s cache are on the CDN integration page.

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 make the module's own in-place path vary images by the browser's Accept header and add Vary: Accept; that path now optimizes an image identically for every client, 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