Skip to content

Latest commit

 

History

History
80 lines (49 loc) · 9.9 KB

glossary.md

File metadata and controls

80 lines (49 loc) · 9.9 KB

Glossary & references

This page gives working definitions for terms involved in bundle preloading and links to definitions for other relevant Web terms which are already well-defined.

🚧 This glossary is a work in progress. If you encounter a confusing term in this proposal, let us know and we'll add an entry! 🚧

What's a bundle?

A bundle is a collection of resources used by a website. For each resource, it includes not only the data for the resource, such as a JavaScript file or image, but also the HTTP response context for the resource, e.g. response headers. In this proposal, 'bundle' often specifically refers to files in the IETF WPACK WG format.

Bundle preloading refers to the process of accessing resources from within bundles, in contrast to accessing resources by requests to their canonical URLs. This proposal focuses on the semantics of bundle preloading.

Bundle preloading terms

These terms are introduced or refined by this proposal. Many of these terms are used elsewhere on the Web, but their meaning has subtleties that are context-dependent. This section defines them more precisely for how they are used throughout this proposal.

  • Resource (also often referred to as an asset): A piece of data needed by a website. For example, JavaScript modules, CSS rulesets, and images are common resources (or parts of resources) used by Web pages. A resource is identified by a URL.

  • Intermediary: An intermediary is any proxy server serving a browser the contents of a site, including transparent proxies and CDNs.

  • Canonical URL: Resources can be accessed in multiple ways. When a resource is contained within a bundle, the path representing that resource is a [URL]. Responses to requests made with the same headers to that URL must have the same payload and headers as the bundled resource to be considered compliant with bundle preloading, and in order to enable progressive enhancement and graceful degradation

  • Preloading: Previously referred to as 'batch prefetching' and 'batch preloading', this proposal focuses on "preloading" of bundled content because content can be requested before the browser is aware of a reference to it. This mechanism allows browsers to avoid downloading parts of a bundle before they are needed to offer a faster Web experience, as well as to avoid downlading resources they already have cached.

  • Bundle subsetting: Bundle preloading involves dynamically serving bundled responses based upon a Bundle-Preload header. A bundler might produce a bundle with many responses, subsets of which are requested by different Web pages or at different times. The process of producing and serving subsets of responses is referred to as 'bundle subsetting'.

  • Signed exchange: A proposal from the Google Chrome team to allow one "distributor" to serve Web content from another "publisher". In its basic form (shipping in Chrome, Edge, and Opera, but explicitly opposed by other engines), Signed exchange does not use bundling, but instead signs an individual HTTP response.

  • Resource identity: URLs form the identity for resources on the Web. Resource bundles represent the same resources as their individual (canonical) URLs indicate. A page depending on a resource should behave identically whether that resource is preloaded from a bundle or fetched on its own; the identity of the resource at that URL does not depend on whether it is loaded from a bundle.

Other helpful terms and references

This is a short index of Web terms referenced in this proposal. Most of these terms are already well-defined, in which case we link to their definitions elsewhere. We provide short definitions or clarifications for a few as they relate to bundle preloading.

HTTP

  • It's very important to know what a URL is to evaluate this proposal.

Relevant HTTP headers:

Other attempts have been made at improving the performance of serving many resources over HTTP.

  • HTTP/2: This reduced much of the overhead of HTTP 1.
  • QUIC (a.k.a. HTTP/3): Improves upon HTTP/2, without server push.

Bundlers

A bundler is a piece of software that packages resources for a website into different bundles, whether using the IETF WPACK WG format or by concatenating JavaScript files, spriting images, etc. Most bundlers aim to make website loading faster, and many enable additional JavaScript features, such as modules, by transpiling code for older browsers.

Some popular bundlers include webpack, rollup, Parcel and esbuild.

Many bundlers employ the following optimization techniques:

  • Code splitting

  • CSS concatenation: By putting many CSS rulesets into a single file, per-file overhead is reduced.

  • Image spriting

  • Minification: Can be applied to both JS and CSS.

  • Tree shaking

  • Virtualization: CSS and images, among other resource types, can often be included in JavaScript files represented as base64 or other data. Though this makes resources loading slower for the browser because JavaScript must decode and insert those resources, it reduces the number of requests needed to deliver all of the resources.

  • Build time: The amount of time it takes a bundler to produce bundled files from its input. Many bundlers focus on offering a fast build time so developers can rapidly reload their changes.

Web performance

  • Cache digest: This page offers a good definition and some background: "A cache digest is sent by the client to the server. It tells the server what the client’s cache contains."
  • Compression: Compressing files reduces the time it takes to send data over the network, at the smaller cost of comperssion and decompression time on each end.
    • Compression dictionary: Many compression algorithms rely on a dictionary of sequences removed from source text. Compressing lots of material with similar content can be more efficient because the resulting dictionary is smaller than material with more unique content.
  • Graceful degradation: Bundle preloading aims to achieve graceful degradation with decent performance for clients and intermediaries that do not support bundling.
  • Lazy loading: Bundle subsetting supports lazy loading.
  • Progressive enhancement: A bundle preloading polyfill can enable progressive enhancement.
  • Revved resources (revving): Unlike the authors' previous approach, revving is left as a choice to bundlers. Bundle preloading supports revving but does not contain any explicit restrictions that enforce or prevent it.
  • Time to interactive (TTI): An important metric for website performance. A website does not necessarily need to load a whole bundle to have a good TTI.

Previous section - Table of contents - Next section