Practical recipes to meet performance budgets for Base MiniApps
const Page = lazy(() => import("./Page")); <Suspense fallback={<Skeleton />}> {" "} <Page />{" "} </Suspense>;
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin /> <link rel="preload" href="/styles/critical.css" as="style" onload="this.onload=null;this.rel='stylesheet'" />
<img src="hero-800.jpg" srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1200.jpg 1200w" sizes="(max-width:600px) 400px, (max-width:900px) 800px, 1200px" loading="lazy" alt="Hero" />
<picture> <source srcset="img.avif" type="image/avif" /> <source srcset="img.webp" type="image/webp" /> <img src="img.jpg" alt="" /> </picture>
res.set("Cache-Control", "public, max-age=31536000, immutable"); res.set("Vary", "Accept-Encoding");
<link rel="preconnect" href="https://api.base.org" /> <link rel="prefetch" href="/next-screen.js" />
transform
opacity
Was this page helpful?