[241205] TIL

์˜ค๋Š˜ ํ•œ ๊ฒƒ

์บ๋Ÿฟ๋งˆ์ผ“ ๊ฐ•์˜ #13.0~ #13.12 ์ˆ˜๊ฐ•

unstable_cache

  • next ํŒ€์ด 14๋ฒ„์ „์—์„œ ๊ณต๊ฐœํ•œ ์บ์‹ฑํ•จ์ˆ˜
  • Functions: 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 ํ•˜๋Š”๊ฐ€

  • ๊ธฐ๋ณธ ๋™์ž‘์€ ์ตœ๋Œ€ํ•œ ๋งŽ์ด ์บ์‹œํ•˜์—ฌ static ํŽ˜์ด์ง€๋กœ ๋งŒ๋“œ๋Š” ๊ฒƒ
  • Functions: generateStaticParams

๋…ธ๋งˆ๋“œ ์ฝ”๋” ํ€ด์ฆˆ ์ œ์ถœ

๊ธฐํƒ€

  • ๋งํ•ด๋ณด์นด
  • ๋ฏธ์ˆ 

Categories:

Updated:

Leave a comment