└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Archive of "Transfer Size Policy" 2 | 3 | **This incubation has been archived and no longer being persued (see [#19](https://github.com/WICG/transfer-size/issues/19)). It may restart if there is renewed insterest.** 4 | 5 | Goal: enable developers to set and enforce limits on network usage by nested contexts (i.e. iframes). 6 | 7 | Today the top-level frame is unable to audit or enforce size limits on resources used by a nested context. For example, the developer may take great care to optimize their assets to fit within a specific quota, but the moment they add a third party resource that uses (or injects) a nested context, they have no way to track or enforce limits on the resulting size. 8 | 9 | In practice, this can result in mis{behaving, configured} parties fetching large amounts of data, which violate site owners expectations and harm the user experience. To address this, frames could trigger an event once they've consumed at least a specified number of bytes over the network. The page could then handle the event in any way it chooses, such as logging it, displaying a notice to the user, [pausing](https://github.com/jkarlin/pause-frame) it, unloading it, etc. There might even be a future API to cancel all current and future network requests for a frame as a response. 10 | 11 | Here is an example which limits an iframe to 300KB total: 12 | 13 | ```html 14 | 19 | 20 |