Skip to content

Commit 0a6860e

Browse files
authored
Performance Control of Embedded Content: update explainer (#1086)
* Add links to issues * add TOC * add Participate section * update issue links in README.md * simplify TOC * add summary and diagram * Add prototype stages * Link to basic category doc * Update diagram text formatting
1 parent 2caa47f commit 0a6860e

File tree

3 files changed

+86
-13
lines changed

3 files changed

+86
-13
lines changed

PerformanceControlOfEmbeddedContent/explainer.md

Lines changed: 84 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,62 @@
11
# Performance control of embedded content
22

3-
## Authors
4-
- [Nishitha Burman Dey](https://github.com/nishitha-burman)
5-
- [Luis Flores](https://github.com/lflores-ms)
6-
- [Andy Luhrs](https://github.com/aluhrs13)
7-
- [Alex Russell](https://github.com/slightlyoff)
3+
**Authors:** [Nishitha Burman Dey](https://github.com/nishitha-burman), [Luis Flores](https://github.com/lflores-ms), [Andy Luhrs](https://github.com/aluhrs13), [Alex Russell](https://github.com/slightlyoff)
4+
5+
This proposal introduces four [Document Policy](https://github.com/WICG/document-policy/blob/main/document-policy-explainer.md) configuration points to constrain the performance impact of iframes in the embedding document. Each configuration point enables monitoring for performance-impacting behavior in the iframe, and reports occurrences of such behavior as policy violations through [Reporting API](https://wicg.github.io/document-policy/#reporting). Violations are reported to both the embedding and embedded document. Resources that incur policy violations are blocked from loading.
6+
7+
A working prototype for the first category `basic` is to be implemented in the following stages:
8+
* **Stage 1.** Configuration point and policy monitoring, reporting.
9+
* **Stage 2.** Resource blocking.
10+
* **Stage 3.** Cross-document reporting.
11+
12+
More details on the behavior for the `basic` category can be found in ["basic" category overview](https://docs.google.com/document/d/1RGxvtkoQbvApLVdipiASoUQjC0Jf-IKD9qV1EfUJHAQ).
13+
14+
![Example of resource blocked by policy](
15+
images/diagram.svg)
16+
17+
## Participate
18+
<a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/Performance%20Control%20of%20Embedded%20Content">![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/Performance%20Control%20of%20Embedded%20Content?label=issues)</a>
19+
[Open an issue](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?template=performance-control-of-embedded-content.md)
20+
21+
## Table of Contents
22+
23+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
24+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
25+
26+
- [Introduction](#introduction)
27+
- [Goals](#goals)
28+
- [Non-goals](#non-goals)
29+
- [Use cases and scenarios](#use-cases-and-scenarios)
30+
- [Proposed Solution](#proposed-solution)
31+
- [Categories and criteria](#categories-and-criteria)
32+
- [Discussion of different categories](#discussion-of-different-categories)
33+
- [Example](#example)
34+
- [API Design Discussion](#api-design-discussion)
35+
- [Using multiple Document Policy configuration points](#using-multiple-document-policy-configuration-points)
36+
- [Opt-in and policy negotiation](#opt-in-and-policy-negotiation)
37+
- [Negotiation vs enforcement](#negotiation-vs-enforcement)
38+
- [Open question: required policy and report-only mode](#open-question-required-policy-and-report-only-mode)
39+
- [What should be standardized?](#what-should-be-standardized)
40+
- [Security and Privacy Considerations](#security-and-privacy-considerations)
41+
- [Potential privacy implications of blocking embedded content](#potential-privacy-implications-of-blocking-embedded-content)
42+
- [Global budgets and side-channel attacks](#global-budgets-and-side-channel-attacks)
43+
- [Frame depth](#frame-depth)
44+
- [Dependencies on non-stable features](#dependencies-on-non-stable-features)
45+
- [Alternatives considered](#alternatives-considered)
46+
- [Custom attributes and headers](#custom-attributes-and-headers)
47+
- [Levels vs. categories](#levels-vs-categories)
48+
- [Open Issues](#open-issues)
49+
- [Policy enforcement options](#policy-enforcement-options)
50+
- [Limits need to be defined](#limits-need-to-be-defined)
51+
- [Criteria and category definition, evolution](#criteria-and-category-definition-evolution)
52+
- [Per-document constraints](#per-document-constraints)
53+
- [Reporting 3rd party violations to embedder](#reporting-3rd-party-violations-to-embedder)
54+
- [Interaction with Heavy Ad Interventions](#interaction-with-heavy-ad-interventions)
55+
- [Open question: how can we ensure fair restrictions for various types of devices (e.g. low end vs. high end devices)?](#open-question-how-can-we-ensure-fair-restrictions-for-various-types-of-devices-eg-low-end-vs-high-end-devices)
56+
- [Open question: how to determine categories/criteria/limits for desktop vs. mobile?](#open-question-how-to-determine-categoriescriterialimits-for-desktop-vs-mobile)
57+
- [References & acknowledgements](#references--acknowledgements)
58+
59+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
860

961
## Introduction
1062

@@ -141,6 +193,9 @@ There are various layers of configuration that can happen and we need to ensure
141193

142194
## Security and Privacy Considerations
143195

196+
### Potential privacy implications of blocking embedded content
197+
We propose to [report violations across documents](#reporting-3rd-party-violations-to-embedder). These reports may expose information about the embedded document state to the embedder. We consider that because policies defined through Document Policy require opt-in, the embedded document accepts the risks by agreeing to the policy. See discussion in [#1077](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1077) (resource blocking) and [#1085](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1085) (reporting leaks).
198+
144199
### Global budgets and side-channel attacks
145200
The proposed criteria include budgets which are shared globally across documents. This could allow for documents to learn things about cross-origin documents, as described in the [Never Slow Mode explainer](https://github.com/slightlyoff/never_slow_mode?tab=readme-ov-file#global-limits). We consider the same alternatives introduced for NSM as viable for this proposal:
146201
* Require CORS
@@ -188,10 +243,19 @@ With this approach, adding a new group of constraints would only be possible by
188243

189244
## Open Issues
190245

191-
### Per-document constraints
192-
Document Policy directives are effective on a per-document basis. This generally makes it harder for constraints to have the desired impact to improve performance, as the overall cap on resources increases with the complexity of the page. We propose capping the overall complexity and resources through frame depth and count restrictions to avoid an unbound upper limit to page resource consumption.
246+
### Policy enforcement options
247+
We aim to block loading for resources that violate the `basic` policy. Non-breaking enforcement might help with adoption. See discussion in [#1082](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1082) and [#1079](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1079).
193248

194-
What would be the appropriate frame count and depth limit? See related discussion in [Security and Privacy Considerations](#frame-depth).
249+
### Limits need to be defined
250+
We propose to have concrete limits managed by the platform, but defaults can't change without breakage. See discussion in [#1083](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1083) and [#1084](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1084).
251+
252+
**`basic` category limits**
253+
* HTTP-based compression of text-based resources
254+
* Opt for compressed formats when available (non text-based resources)
255+
* Keep size of non-HTTP compressed resources low
256+
* data: URLs: 100kB
257+
* Images: 1MB
258+
* Fonts: 96kB
195259

196260
### Criteria and category definition, evolution
197261
This proposal provides an affordance for web developers to gain back control over the performance of their web property. A set of performance-impacting criteria was derived from [Never Slow Mode](https://github.com/slightlyoff/never_slow_mode?tab=readme-ov-file#global-limits) and experience in the field (see note in [Proposed Solution](#proposed-solution)). These criteria were then grouped into buckets, taking into account their overall impact, stage in the document lifetime and estimated effort from the developer to fix.
@@ -213,9 +277,19 @@ We expect these criteria and their specific limits to evolve with the web, which
213277
3. **Updated criteria under new category tags**
214278
| **Pros** | **Cons** |
215279
|---|---|
216-
|- Web developers can anticipate and address violations. | - Requires changes from sites each time there's a change in a category. |
280+
|- Web developers can anticipate and address violations. | - Requires changes from sites each time there's a change in a category.<br>- New configuration point required for every policy change. |
281+
282+
4. **Use versioning**
283+
Bundle criteria updates into versions of the policy and let the document specify which policy version is requested or opted-in to by using a parameterized configuration point instead. Sites need to actively adopt new versions of the policy.
284+
| **Pros** | **Cons** |
285+
|---|---|
286+
|- Web developers can anticipate and address violations.<br>- Changes can happen within the same configuration point. | - Requires changes from sites each time there's a change in a category. |
287+
Versioning is the preferred mechanim as it allows for policy evolution to happen in a controlled, predictable manner.
288+
289+
### Per-document constraints
290+
Document Policy directives are effective on a per-document basis. This generally makes it harder for constraints to have the desired impact to improve performance, as the overall cap on resources increases with the complexity of the page. We propose capping the overall complexity and resources through frame depth and count restrictions to avoid an unbound upper limit to page resource consumption.
217291

218-
An ideal mechanism would allow for this evolution go happen in a controlled, predictable manner. An open point for discussion is whether it's a reasonable trade off for developers opting in to be expected to keep up with the platform as criteria evolves.
292+
What would be the appropriate frame count and depth limit? See related discussion in [Security and Privacy Considerations](#frame-depth).
219293

220294
### Reporting 3rd party violations to embedder
221295
Embedders are best equipped to influence change in the performance when they are aware of where the issues are. While Document Policy provides a Reporting API integration, this only reports violations to the endpoint of the document where the violation occurs. Embedders do not receive reports that the embedded content has incurred policy violations, which is a limitation. We are currently considering sending a minimal report to the embedder when a violation occurs in the embedded document.
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)