Purge, regenerate, and promote static page caches, layout shells, and component subtrees on-demand in production when mutative events occur, with zero hydration mismatches and full Edge/Node runtime parity.
Building on Dinou's Rendering & Caching (SSG, ISR & PPR) and 3D Route Segmentation engines, Dinou implements a strictly decoupled two-tier caching architecture:
Controls pre-rendered static artifacts (page.rsc, index.html, layout.rsc) stored on disk (.dinou/dist2/) or Edge KV storage (Cloudflare Workers, Deno KV).
Managed via revalidate (time-based ISR) and server APIs: revalidatePage, revalidateLayout, revalidatePath, and revalidateTag.
Caches React Server Component (RSC) payloads and layout segments in the browser tab memory (pageCache and layoutCache) for instant 0ms navigations and state-preserving transitions.
Controlled via <Link fresh>, router.refresh(), and refreshSlot() without full browser reloads.
revalidatePage(path) regenerates only page.rsc and index.html, leaving all layouts intact.revalidateLayout(path) regenerates only layout.rsc in O(1); child pages lazily re-compose HTML on demand (or use revalidatePath(path) for both).revalidateTag(tag) selectively updates layouts, pages, or micro-slots based on where the tag was defined.<DinouCacheSlot> isolates component subtrees refreshed via refreshSlot() or revalidateTag().Server revalidation APIs are exported from the server-only endpoint "dinou/server", keeping browser client bundles clean, lightweight, and secure.
Only in Mutative Event Contexts: Revalidation APIs (revalidatePage, revalidateLayout, revalidatePath, revalidateTag) are mutative side-effects. They must only be invoked inside Server Functions ("use server") or HTTP Webhook endpoints (such as Headless CMS publishing events via Plugins).
Never Inside Components or getProps: Calling revalidation during the component render phase or within getProps creates an infinite regeneration loop, causing severe CPU exhaustion and server crashes.
revalidatePage (Surgical Page Invalidation)Exported from "dinou/server", revalidatePage(path) is specifically designed for scenarios where only the leaf page content has changed:
layout.rsc).page.rsc (or PPR shell.rsc) and composes it with the existing cached parent layout.rsc to atomically update the route's index.html (or PPR shell.html).Call revalidatePage directly inside your Server Functions or route handlers:
// src/blog/server-functions.ts
"use server";
import { revalidatePage } from "dinou/server";
import db from "@/lib/db";
export async function updateArticle(slug: string, newContent: string) {
await db.articles.update({
where: { slug },
data: { content: newContent, updatedAt: new Date() },
});
// Regenerates ONLY page.rsc and index.html for this blog post
// Parent layout.rsc is NOT touched!
await revalidatePage(`/blog/${slug}`);
}page.rsc: Runs the server component renderer for that route's page.tsx and atomically promotes the new RSC payload.index.html: Re-renders the complete HTML (or PPR static shell) for initial visits and SEO crawlers by combining the fresh page with the cached layout chain.layout.rsc) completely untouched, saving valuable CPU cycles on complex or shared layouts.page.rsc and index.html atomically.revalidateLayout (Surgical Layout Invalidation)Exported from "dinou/server", revalidateLayout(path) is the horizontal counterpart to revalidatePage. It surgically regenerates only the layout.rsc artifact for that route segment in O(1) time, executing 0 page.tsx files:
// src/dashboard/server-functions.ts
"use server";
import { revalidateLayout } from "dinou/server";
import db from "@/lib/db";
export async function updateWorkspaceBranding(newTitle: string) {
await db.settings.updateBranding({ title: newTitle });
// Regenerates ONLY /dashboard's layout.rsc in O(1) time (0 child pages executed!)
await revalidateLayout("/dashboard");
}In traditional static frameworks, updating a layout shared by 100,000 child pages forces an impossible choice: either eagerly rebuild all 100,000 child HTML files at once (saturating CPU and crashing the server), or update only the layout payload and suffer Hydration Mismatches when a user hard-reloads (F5) a child page whose index.html still contains the old layout markup.
Dinou solves this automatically through Lazy On-Demand HTML Re-composition:
revalidateLayout("/dashboard") re-executes only src/dashboard/layout.tsx (and its layout_functions.ts), atomically writes the new layout.rsc, and increments layout.metadata.json's monotonic generatedAt timestamp. Zero child pages are executed./dashboard (e.g. /dashboard/team/layout.tsx), Dinou detects the newer parent layout timestamp when a route under /dashboard/team is visited and lazily updates the nested layout.rsc on demand.index.html Re-composition (0 page.tsx Executions): The next time any child route (e.g. /dashboard/analytics) is requested via hard reload (F5) or direct URL visit, Dinou sees that layout.metadata.json is newer than the page's metadata.json. It immediately re-composes a fresh index.html (or PPR shell.html) by combining the already-cached page.rsc with the new layout.rsc—without re-executing the child page.tsx or its getProps()!revalidatePath & Granularity ComparisonHaving introduced revalidatePage (page only) and revalidateLayout (layout only), this section covers revalidatePath (both together), compares all three APIs, and shows how relative paths are resolved.
revalidatePath)Exported from "dinou/server", revalidatePath(path) is a convenience helper for when a mutation updates both the layout and the page located at that exact route path. Internally, it runs revalidateLayout(path) (if a layout exists in that segment) followed by revalidatePage(path):
// src/dashboard/server-functions.ts
"use server";
import { revalidatePath } from "dinou/server";
export async function refreshDashboardSegment() {
// Revalidates /dashboard's layout.rsc (if present in that folder) AND /dashboard's page.rsc + index.html
await revalidatePath("/dashboard");
}{ cascade: true } OptionrevalidatePath(path, { cascade: true }) and revalidateTag(tag, { cascade: true }) accepted a second options argument to eagerly rebuild all child routes' index.html files when a layout changed. Because Dinou now performs Lazy On-Demand HTML Re-composition automatically whenever a layout is updated, the second parameter is deprecated and ignored (emitting a console warning if passed).revalidatePage vs. revalidateLayout vs. revalidatePathChoose the server invalidation primitive that matches the exact scope of your data change:
| Feature | revalidatePage(path) | revalidateLayout(path) | revalidatePath(path) |
|---|---|---|---|
Page RSC (page.rsc) | Regenerated | Untouched (0 page.tsx runs) | Regenerated |
Segment Layout (layout.rsc) | Untouched (0 layout.tsx runs) | Regenerated in O(1) | Regenerated (if layout exists) |
HTML (index.html) | Regenerated immediately for path | Lazily re-composed on demand when visited | Regenerated immediately for path (+ lazy for child routes) |
| Ideal Use Case | Article edits, product price updates, leaf page mutations | Navbar/sidebar updates, branding changes, layout-level stats | Mutations that update both the segment's layout and its index page |
All three path helpers—revalidatePage, revalidateLayout, and revalidatePath—accept both absolute route pathnames (e.g. "/catalog") and relative paths ("./", "..", "../featured") when called inside Server Functions. Dinou resolves relative paths against the automatic x-dinou-current-path request header attached by its client Server Function proxy (so resolution works reliably even under strict Referrer-Policy: no-referrer policies), falling back to the HTTP Referer header and ctx.req.path:
// src/products/server-functions.ts
"use server";
import { revalidatePath, revalidatePage, revalidateLayout } from "dinou/server";
import db from "@/lib/db";
export async function updateCategory(
categoryId: string,
data: { name: string }
) {
await db.categories.update({ where: { id: categoryId }, data });
// 1. Absolute paths:
await revalidateLayout("/catalog"); // Layout-only O(1) update
await revalidatePath("/catalog"); // Layout + index page update
// 2. Relative paths inside Server Functions (resolved via x-dinou-current-path):
// If invoked from /catalog/electronics/edit:
await revalidatePage("./"); // -> /catalog/electronics/edit (leaf page only)
await revalidateLayout(".."); // -> /catalog/electronics (parent layout only)
await revalidatePath("../featured"); // -> /catalog/electronics/featured (layout + page)
}revalidateTag (Cross-Cutting Invalidation)Purges all static pages, layouts, and component subtrees tagged with a specific key string across your entire application with a single call:
// src/products/server-functions.ts
"use server";
import { revalidateTag } from "dinou/server";
import db from "@/lib/db";
export async function syncInventory() {
// Invalidates all routes and slots carrying the "products" tag
await revalidateTag("products");
}getCacheTags)To attach cache tags to a route, export getCacheTags from your page_functions.ts (using PageFunctions) or layout_functions.ts (using LayoutFunctions):
Ideal for fixed tags on static routes:
// src/blog/page_functions.ts
import type { PageFunctions } from "./dinou";
export const getCacheTags: PageFunctions["getCacheTags"] = [
"blog",
"marketing",
];Zero-boilerplate contextual typing via "./dinou":
// src/products/[id]/page_functions.ts
import type { PageFunctions } from "./dinou";
export const getCacheTags: PageFunctions["getCacheTags"] = (params) => {
// params?.id is inferred as string | undefined
return ["products", `product-${params?.id}`];
};You can also pass the route pattern explicitly to PageFunctions (or LayoutFunctions) imported from root "dinou":
// src/products/[id]/page_functions.ts
import type { PageFunctions } from "dinou";
export const getCacheTags: PageFunctions<"/products/[id]">["getCacheTags"] = (
params
) => {
return ["products", `product-${params?.id}`];
};getCacheTags is synchronous or async (such as querying a database or CMS with await). Dinou's return contract (string[] | Promise<string[]>) polymorphically accommodates both forms without requiring separate types.In Dinou, revalidateTag(tag) inspects where the tag was defined and executes the most surgical revalidation action possible:
Defined in layout_functions.ts.
Dinou executes revalidateLayout(path), regenerating exclusively layout.rsc in O(1) time (0 child pages executed).
When any child route is next visited, Dinou lazily re-composes its index.html on demand by combining the cached page.rsc with the fresh layout.rsc—guaranteeing zero hydration mismatches!
Defined in page_functions.ts.
Dinou executes revalidatePage(path), regenerating exclusively page.rsc and index.html.
Parent layouts remain completely untouched—even if the page shares a folder with a layout.tsx—avoiding unnecessary layout recompilations.
Defined in <DinouCacheSlot>.
Dinou purges only the slot directory or KV key and splices the refreshed slot into any Static Shell that hosts it without re-running layout.tsx or page.tsx.
Mounted client views can also refresh the slot in place via refreshSlot(tag).
Follow these best practices to maintain optimal cache hit rates and minimum server CPU usage:
Call revalidateLayout("/dashboard") or declare the tag only in layout_functions.ts (e.g. ["dashboard-shell"]). Dinou regenerates only layout.rsc immediately and lazily re-composes child index.html files on demand when visited—preventing both hydration mismatches on hard reloads (F5) and CPU avalanches on 100k+ page sites.
Use revalidatePage("/path") or declare the tag only in page_functions.ts (e.g. ["post-view"]). Only that concrete page and its HTML will recompile, reusing the cached parent layout chain.
When a single mutation modifies data fetched by both a layout and a child page's own getProps / Server Component, use revalidatePath("/dashboard") (for a single route segment) or attach a shared tag to both layout_functions.ts and the specific affected page_functions.ts files.
<DinouCacheSlot> SubtreesrevalidateTag works seamlessly with micro-cached component subtrees created via <DinouCacheSlot> (see 3D Route Segmentation for vertical slot isolation):
// Inside any page or layout Server Component:
import { Suspense } from "react";
import { DinouCacheSlot } from "dinou/server";
import { TrendingProducts, TrendingSkeleton } from "@/components/trending";
<Suspense fallback={<TrendingSkeleton />}>
<DinouCacheSlot id="trending-grid" tag="trending" revalidate={600}>
<TrendingProducts />
</DinouCacheSlot>
</Suspense>
// In your Server Function:
"use server";
import { revalidateTag } from "dinou/server";
export async function refreshTrends() {
// Matches custom tag/tags ("trending") or the slot's id ("trending-grid") directly
await revalidateTag("trending");
// Only the <TrendingProducts> slot payload is purged; the parent page stays cached!
}Dinou provides a seamless SPA router experience with in-memory caching and granular refresh capabilities directly in the browser:
pageCache & layoutCache)The Dinou client router maintains two internal in-memory maps in the browser tab:
Stores RSC payloads for previously visited routes. Repeat navigations or back/forward clicks resolve in 0ms network time directly from memory.
When navigating between sibling pages sharing a layout (e.g. from /dashboard/analytics to /dashboard/settings), the layout is neither re-fetched nor re-mounted. Video players keep playing, inputs keep focus, and sidebar scroll positions persist unbroken.
<Link fresh>Add the fresh prop to any <Link> component to bypass the client-side cache for that navigation:
import { Link } from "dinou";
// Clicking this link deletes pageCache for /feed before navigating,
// guaranteeing a real HTTP request to fetch fresh data from the server.
<Link href="/feed" fresh>
View Latest Feed
</Link>Note: <Link fresh> deletes the client in-memory cache for that destination; it does not clear static files on the server. If the server route is static, the server will return the compiled static RSC payload.
router.refresh() & Layout InvalidationThe useRouter() hook provides a powerful refresh() method that reconciles React components without losing ephemeral client state (such as input focus, form draft text, or scroll position):
"use client";
import { useRouter } from "dinou";
export function RefreshControl() {
const router = useRouter();
// 1. Standard Soft Refresh (Default)
// Clears only pageCache; leaves layoutCache intact (1 network request, 0 layout flicker)
const handlePageRefresh = () => {
router.refresh();
};
// 2. Full Refresh (Including Layout Shell)
// Clears pageCache AND purges active layoutCache (fetches both fresh layout & page)
const handleGlobalRefresh = () => {
router.refresh({ layout: true });
};
return (
<div className="flex gap-2">
<button onClick={handlePageRefresh}>Refresh Page</button>
<button onClick={handleGlobalRefresh}>Refresh All (Shell + Page)</button>
</div>
);
}| Method Call | pageCache | layoutCache | RSC Network Requests | Best For |
|---|---|---|---|---|
| router.refresh() | Deleted | Preserved | 1 (page only) | Post-mutation updates, comment submissions, data table refreshes |
| router.refresh({ layout: true }) | Deleted | Deleted | 2 (layout + page) | Tenant switching, avatar changes, global theme or org updates in navbar |
refreshSlot & router.refreshSlotTo refresh an isolated <DinouCacheSlot> subtree in place without re-rendering sibling components or parent pages, use refreshSlot(idOrTag, options) (or router.refreshSlot(idOrTag, options)). Both return a Promise<void> and accept a unique slot id, a shared cache tag (refreshing every matching slot carrying that tag), or "*" (refreshing all mounted slots on the active view plus session-cached slots from previously visited pages):
"use client";
import { useState } from "react";
import { refreshSlot, useRouter } from "dinou";
export function LiveAnalyticsButton() {
const router = useRouter();
const [isPending, setIsPending] = useState(false);
const handleUpdate = async () => {
setIsPending(true);
try {
// 1. Refresh a single slot ID (or pass a shared tag / "*" for all mounted slots):
await refreshSlot("analytics-summary", { fresh: true });
// 2. Or via router instance (identical Promise<void> signature and options):
// await router.refreshSlot("analytics-summary", { fresh: true });
} finally {
setIsPending(false);
}
};
return (
<button onClick={handleUpdate} disabled={isPending}>
{isPending ? "Refreshing..." : "Live Refresh Metrics"}
</button>
);
}fresh: false)Respects the server storage cache. If the slot has not exceeded its revalidate TTL, the server returns the cached JSX directly without re-executing the component.
Use Case: Bringing the client DOM in sync with existing server state (for instance, after a Server Function or background task has already executed revalidateTag).
fresh: true (Forced Server Recomputation)Bypasses any unexpired server cache, forces Dinou to immediately re-evaluate the slot's Server Component, updates the slot cache, and automatically splices the fresh slot into the host route's cached static/PPR HTML shell without re-executing page.tsx or layout.tsx—so subsequent hard reloads (F5) also serve the updated UI!
Use Case: Explicit user-initiated refresh triggers (such as clicking a "Live Sync" button) where the user demands live data regardless of remaining TTL.
Revalidation (revalidatePage, revalidateLayout, revalidatePath, revalidateTag) is fundamentally the process of purging and rebuilding static cache artifacts. To understand why storage adapters exist, it helps to see what Dinou actually stores and where those files live.
Pre-rendered static HTML delivered immediately to web crawlers and initial browser page loads.
Serialized React Server Components streams consumed by Dinou's client router during SPA transitions.
Expiration timestamps, ISR time-to-live (TTL), and assigned cache tags for surgical resolution.
By default, Dinou writes to local disk (FileSystemStorage). If you scale to 4 Kubernetes pods or Docker containers behind a load balancer, each pod has an isolated disk. Without a shared adapter, a purge on Pod A leaves Pods B, C, and D serving stale cache.
In serverless runtimes like Cloudflare Workers, there is no writable filesystem. Dinou auto-binds to your DINOU_CACHE KV namespace at runtime. You never configure dinou.config.ts—simply add the KV binding to wrangler.toml. Deno Deploy works identically with zero-config Deno KV.
Unit tests, CI pipelines, and ephemeral mock runs require ultra-fast execution without disk clutter or external database infrastructure dependencies.
Because your application code only interacts with high-level revalidation functions like revalidateTag("products") or revalidatePath("/catalog"), your UI and server components remain 100% identical whether you run on a single local Node.js VPS (FileSystemStorage), scale to a multi-pod Kubernetes cluster (RedisStorage in dinou.config.ts), or deploy to global Cloudflare Workers (automatic CloudflareKVStorage via wrangler.toml).
| Adapter Class | Target Environment | Characteristics |
|---|---|---|
| FileSystemStorage | Node.js / Bun / Docker | Default. Zero config, atomic file writes in .dinou/dist2. |
| RedisStorage | Distributed Clusters | Shared cluster cache across Kubernetes pods or multi-container VPS (default prefix "dinou:cache:", lazy .dinou/dist2 hydration & cluster tombstones). |
| CloudflareKVStorage | Cloudflare Workers | Globally replicated edge key-value storage. Auto-bound via DINOU_CACHE in wrangler.toml (zero config). |
| DenoKVStorage | Deno Deploy / Deno KV | Built-in distributed ACID key-value store. Auto-bound via Deno.openKv() (zero config). |
| MemoryStorage | Testing / CI / Serverless Fallback | Isolated in-memory ephemeral Map for unit tests, read-only containers, and Netlify/Edge fallbacks (hydrateFromDisk: false by default; pass { hydrateFromDisk: true } to lazily hydrate pre-rendered .dinou/dist2 artifacts on read-only filesystems). |
In Node.js / Bun environments, override the default local disk storage by declaring a distributed adapter (such as RedisStorage) in dinou.config.ts (or dinou.config.js). During npm run build, static generation still writes exclusively to .dinou/dist2 without touching Redis, and at runtime cold pods lazily hydrate pre-rendered artifacts into Redis on first access (compatible with redis v4/v5, ioredis, and @upstash/redis):
// dinou.config.ts
import { defineConfig } from "dinou";
import { RedisStorage } from "dinou/server";
import { createClient } from "redis";
const redis = createClient({ url: process.env.REDIS_URL });
await redis.connect();
export default defineConfig({
// Accepts an optional string prefix (default "dinou:cache:")
// or options object: { prefix?: string; hydrateFromDisk?: boolean }
storage: new RedisStorage(redis, { prefix: "dinou:cache:" }),
});Unlike FileSystemStorage (which writes physical files to disk) or RedisStorage (which communicates over network TCP), MemoryStorage keeps all cached HTML, RSC streams, and tag metadata exclusively inside a JavaScript Map in process memory. When the process exits, memory is instantly freed with zero disk traces.
Writing to disk in Vitest/Jest causes test cross-talk (Test 1 leaves cache files that break Test 2). Calling setStorageAdapter(new MemoryStorage()) gives every test a pristine, isolated store in 0 microseconds without cleaning temp folders.
Validate full ISR and revalidation lifecycles (revalidateTag, revalidatePath) in automated CI runners without provisioning or maintaining external Redis service containers.
In high-security enterprise environments running with docker --read-only, local filesystem writes fail with EROFS. MemoryStorage enables full caching and revalidation purely inside container RAM.
On Cloudflare Workers without a DINOU_CACHE KV binding—or on Netlify Functions v2 (where Dinou initializes new MemoryStorage({ hydrateFromDisk: true }) by default)—Dinou operates cleanly inside runtime memory without crashing.
// 1. In dinou.config.ts (conditional for CI / test environment)
import { defineConfig } from "dinou";
import { MemoryStorage, RedisStorage } from "dinou/server";
export default defineConfig({
// Use in-memory cache during tests to avoid external database dependencies
storage: process.env.NODE_ENV === "test"
? new MemoryStorage()
: new RedisStorage(redisClient, "dinou:cache:"),
});
// 2. Or directly in your test suite (Vitest / Jest) for total test isolation
import { setStorageAdapter, MemoryStorage, revalidateTag } from "dinou/server";
import { beforeEach, test, expect } from "vitest";
beforeEach(() => {
// Reset cache state with a clean, isolated in-memory store before every test
setStorageAdapter(new MemoryStorage());
});Note for external worker scripts: If you run standalone background scripts or CLI tools outside the Dinou web server that need to perform cache purges, you can imperatively bind the storage adapter using setStorageAdapter(adapter) or inspect the active instance via getStorageAdapter() from "dinou/server".
External events, such as a Headless CMS (Sanity, Strapi, Contentful) publishing content or an e-commerce inventory sync, can trigger on-demand revalidation in Dinou. Webhook endpoints are created via Web Standards Plugins using the onRequest hook in dinou.config.ts (or dinou.config.js):
// dinou.config.ts
import { defineConfig } from "dinou";
import { revalidateTag, revalidatePage, revalidateLayout, revalidatePath } from "dinou/server";
interface RevalidatePayload {
tag?: string;
page?: string;
layout?: string;
path?: string;
}
export default defineConfig({
plugins: [
{
name: "revalidation-webhook",
async onRequest(request) {
const url = new URL(request.url);
// Intercept POST requests to /api/revalidate
if (url.pathname === "/api/revalidate" && request.method === "POST") {
try {
const { tag, page, layout, path } =
(await request.json()) as RevalidatePayload;
if (tag) {
await revalidateTag(tag);
}
if (page) {
// Surgical page-only revalidation
await revalidatePage(page);
}
if (layout) {
// Surgical O(1) layout-only revalidation (lazy HTML re-composition)
await revalidateLayout(layout);
}
if (path) {
// Combined segment revalidation (layout + page)
await revalidatePath(path);
}
return Response.json({ revalidated: true, timestamp: Date.now() });
} catch (err: unknown) {
const message =
err instanceof Error ? err.message : "Invalid webhook payload";
return Response.json({ error: message }, { status: 500 });
}
}
},
},
],
});In production, verify an authorization header (such as request.headers.get("authorization") === `Bearer ...`) or a cryptographic HMAC webhook signature from your CMS provider to ensure only authorized callers can trigger revalidation cycles.
Comprehensive reference guide for choosing the optimal invalidation and refresh mechanism in Dinou:
Executed inside Server Functions, Webhook plugins, or route configurations to purge server-side HTML, React Server Component payloads, and storage caches:
| Mechanism | Invocation Context | Invalidation Scope (Server) | Primary Use Case |
|---|---|---|---|
| revalidate = N | page / layout_functions.ts | Time-based SWR cache TTL | Automatic background freshness for low-to-medium dynamic content. |
| revalidatePage(path) | Server Function / Webhook Plugin | Target page only (HTML + RSC) | Surgical route mutation; guarantees zero impact on parent layout shells. |
| revalidateLayout(path) | Server Function / Webhook Plugin | Target layout only (O(1) layout.rsc + lazy HTML) | Surgical layout mutation; child pages lazily re-compose HTML on demand with 0 page.tsx runs. |
| revalidatePath(path) | Server Function / Webhook Plugin | Target layout segment + page | Combined segment mutation when both the segment's layout and page update. |
| revalidateTag(tag) | Server Function / Webhook Plugin | Matching layout, page, or <DinouCacheSlot> | Cross-cutting surgical purge of any tagged layout, page, or micro-slot. |
Executed inside Client Components and user interactions to invalidate browser router caches without triggering a full browser window reload (F5):
| Mechanism | Invocation Context | Client Cache Impact | Preserves UI State? | Bypasses Server Storage? |
|---|---|---|---|---|
| <Link fresh> | <Link> navigation | Bypasses & evicts pageCache | No (navigates to route) | No (serves server storage cache) |
| router.refresh() | useRouter() hook | Evicts pageCache for current URL | Yes (inputs, scroll, layout preserved) | No (serves server storage cache) |
| router.refresh({ layout: true }) | useRouter() hook | Evicts both pageCache & layoutCache | Yes (inputs & scroll preserved; layout re-renders) | No (serves server storage cache) |
| refreshSlot(idOrTag, [options]) | refreshSlot / useRouter() | Re-fetches and replaces matching slot DOM (by ID, tag, or "*") | Yes (entire page, layout & scroll preserved) | Only with { fresh: true } (+ splices host shell) |