profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Hybrid

Collection of Pages with ComponentsTypes of ComponentsSetup server sent events (SSE) content refetchAdminipaneeli puhverserveri seadistamineCEL Scripting in Template BuilderProject ScaffoldingMedia Library

Headless

KiirkäivitusSplit Screen JSON Component Builder with LLMComponent Zod Pull

RESTi API

REST API OverviewgetConnect your websitegetMarsruutide hankiminegetGET /routegetGET /blocksgetGET /blocks/with-cel-cachegetGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}getGET /content-changes (SSE)patchPATCH /dataset/{schema_name}postPOST /translationpatchPATCH /translationsgetGET /usagepostPOST /csvpatchPATCH /csv
All Systems Operational
Powered Byprofound-logo
Theme

Setup server sent events (SSE) content refetch

See funktsioon võimaldab uuesti renderdada lehti, mille sisu muudeti „Admin Panelis”

See funktsioon võimaldab uuesti renderdada lehti, mille sisu muudeti „Admin Panelis”.

Vaikimisi esitatakse lehed staatiliste versioonidena.

  1. Kasutades meie renderdaja uusimat versiooni.
  2. See kasutab Server-sent events'i (SSE), et tuvastada muudatused asjakohastes andmebaasiüksustes.

Muudame faili layout.tsx.

import { Refresher } from 'cms-renderer/lib/refresher';
import { revalidatePath } from 'next/cache';

// function to run on revalidation
async function revalidate() {
  'use server';
  revalidatePath('/', 'layout'); // re compute cache for these pages
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body className="min-h-screen bg-bg-base text-text-primary antialiased">
        <Refresher // enter correct credentials
          websiteId={"..."}
          cmsUrl={"..."}
          apiKey={"..."}
          
        />
        {children}
      </body>
    </html>
  );
}

Pärast juurpaigutuse muutmist saad oma andmebaasis välju redigeerida ja näed uuendusi pärast lehe värskendamist.

Continue Reading
Previous‹Types of ComponentsNextAdminipaneeli puhverserveri seadistamine›