[241205] TIL
์ค๋ ํ ๊ฒ
์บ๋ฟ๋ง์ผ ๊ฐ์ #13.0~ #13.12 ์๊ฐ
unstable_cache
revalidate
- revalidatePath, revalidateTag
import { unstable_cache as nextCache, revalidateTag } from "next/cache";
const getCachedProductTitle = nextCache(getProductTitle, ["product-title"], {
tags: ["product-title", "xxxx"],
});
const getCachedProduct = nextCache(getProduct, ["product-detail"], {
tags: ["product-detail", "xxxx"],
});
const revalidate = async () => {
"use server";
revalidateTag("xxxx");
};
Next.js ๊ฐ route๋ฅผ ์ด๋ป๊ฒ cache ํ๋๊ฐ
๋
ธ๋ง๋ ์ฝ๋ ํด์ฆ ์ ์ถ
๊ธฐํ
Leave a comment