Skip to content

Docs: Using the Speculation Rules API for faster page loads #41907

@coliff

Description

@coliff

Prerequisites

Proposal

Bootstrap's docs are already very fast as they are static HTML, but page load performance can be further improved with a tiny snippet of code in the <head>. This only works in Chromium browsers at moment but I think it's a nice progressive enhancement. I use it on all sites I work on.

<script type="speculationrules">
{
  "prerender": [{
    "where": {
      "href_matches": "/*"
    },
    "eagerness": "moderate"
  }]
}
</script>

Further reading:

Motivation and context

Even faster docs!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions