Widget Iframe Page Caching
Widget iframe pages are now statically generated at build time and served with aggressive HTTP caching headers. This significantly improves widget load times, allowing end users to experience near-instant iframe rendering on repeat visits.
The following changes have been made:
- Widget iframe pages are statically generated (SSG) instead of server-side rendered, so responses are pre-built at deploy time rather than generated on each request.
- Responses include
Cache-Control: public, max-age=31536000, immutable, allowing browsers and CDNs to cache widget iframe pages for up to one year without revalidation. - The cache is automatically busted on every deploy via a
buildIdquery parameter appended to each iframe URL, derived from the Next.js build identifier. This ensures that end users always receive the latest version after a new deployment.
Once a widget iframe page is cached by the browser, subsequent page loads skip the network round-trip entirely. Combined with static generation, this removes server processing time from the equation and delivers the fastest possible load experience for end users.