Webhooks for the AT Protocol airglow.run
atproto atprotocol automation webhook
12
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: speculation rules

Hugo 545e8e08 e16fb42c

+24
+24
app/routes/_renderer.tsx
··· 31 31 const themeToggleCss = Object.values(themeToggleCssModules)[0] ?? ""; 32 32 const inlineIslandCss = themeToggleCss ? raw(`<style>${themeToggleCss}</style>`) : null; 33 33 34 + // Speculation Rules (Chromium). `moderate` eagerness triggers on hover / 35 + // pointerdown, not page load — bots and bouncing users don't spend origin 36 + // quota. Non-supporting browsers ignore the script. 37 + // prerender: high-confidence CTAs. Next click is ~0ms perceived. 38 + // prefetch: broad list-style destinations. Fills the HTTP cache only, 39 + // so a mis-guess is cheap (no JS/render budget consumed). 40 + const speculationRules = raw( 41 + `<script type="speculationrules">${JSON.stringify({ 42 + prerender: [ 43 + { 44 + where: { href_matches: ["/auth/login", "/dashboard"] }, 45 + eagerness: "moderate", 46 + }, 47 + ], 48 + prefetch: [ 49 + { 50 + where: { href_matches: ["/lexicons/*", "/u/*"] }, 51 + eagerness: "moderate", 52 + }, 53 + ], 54 + })}</script>`, 55 + ); 56 + 34 57 // In production, read the Vite manifest to emit blocking <link> tags for CSS. 35 58 // Walk from `isEntry` chunks along static `imports` only — dynamic-import chunks 36 59 // (islands) carry their CSS via Vite's runtime when the island JS loads, so they ··· 93 116 {inlineIslandCss} 94 117 <link rel="icon" href="/favicon.svg" type="image/svg+xml" /> 95 118 <link rel="canonical" href={canonicalUrl} /> 119 + {speculationRules} 96 120 <title>{pageTitle}</title> 97 121 <meta name="description" content={desc} /> 98 122 <meta name="theme-color" content="#1e1e1e" media="(prefers-color-scheme: dark)" />