SPECULATION_RULES

tcmts.site.SPECULATION_RULES · #jh7cjmhn · term · runs anywhere

Chrome's speculation rules for a static site: a page is prerendered while a link to it is pointed at (or pressed), so following it shows it at once. Downloads aren't.

export const SPECULATION_RULES = `<script type="speculationrules">${JSON.stringify({
  prerender: [
    {
      where: {
        and: [
          { href_matches: "/*" },
          { not: { href_matches: "/*.tar.gz" } },
          { not: { href_matches: "/*.tgz" } },
        ],
      },
      eagerness: "moderate",
    },
  ],
})}</script>`

used by