Redesign core pages and connect dynamic content
This commit is contained in:
@@ -4,7 +4,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
type RevalidateBody = {
|
||||
/** Revalidate a fetch cache tag (portfolios, blogs, portfolio:slug, blog:slug, …). */
|
||||
tag?: string;
|
||||
/** Revalidate a path (/portfolios/foo, /, …). */
|
||||
/** Revalidate a path (/projects/foo, /, …). */
|
||||
path?: string;
|
||||
/** Shorthand: portfolios | blogs | all */
|
||||
scope?: "portfolios" | "blogs" | "all";
|
||||
@@ -15,7 +15,7 @@ type RevalidateBody = {
|
||||
*
|
||||
* POST /api/revalidate
|
||||
* Header: x-revalidate-secret: <REVALIDATE_SECRET>
|
||||
* Body (JSON, optional): { "scope": "all" } | { "tag": "portfolios" } | { "path": "/portfolios/item" }
|
||||
* Body (JSON, optional): { "scope": "all" } | { "tag": "portfolios" } | { "path": "/projects/item" }
|
||||
*
|
||||
* nginx may still serve cached HTML for up to its TTL (5m) unless purged separately.
|
||||
*/
|
||||
@@ -50,9 +50,10 @@ export async function POST(req: NextRequest) {
|
||||
} else if (scope === "portfolios" || scope === "all") {
|
||||
revalidateTag("portfolios");
|
||||
revalidatePath("/");
|
||||
revalidatePath("/portfolios");
|
||||
revalidatePath("/projects");
|
||||
revalidatePath("/aboutus");
|
||||
revalidatePath("/our-services");
|
||||
revalidatePath("/atelier");
|
||||
revalidatePath("/raoofi-home");
|
||||
revalidated.push("scope:portfolios");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user