{"id":13448,"date":"2021-05-08T20:30:40","date_gmt":"2021-05-08T11:30:40","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=13448"},"modified":"2023-09-17T13:54:59","modified_gmt":"2023-09-17T04:54:59","slug":"%e3%80%90next-js%e3%80%91%e3%80%8cisrincremental-static-regeneration%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=13448","title":{"rendered":"\u3010Next.js\u3011\u300cISR(Incremental Static Regeneration)\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">ISR(Incremental Static Regeneration)\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u30a2\u30af\u30bb\u30b9\u3092\u8d77\u70b9\u3068\u3057\u3066\u52d5\u7684\u306b\u9759\u7684\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u66f4\u65b0\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><span style=\"color: #ff0000;\"><strong>\u300cStale while revalidation\u300d<\/strong><\/span>\u3068\u8a00\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u304c\u30d9\u30fc\u30b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002Stale\u306f\u300c\u53e4\u3044\u300d\u3068\u8a00\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ISR\u306e\u4ed5\u7d44\u307f<\/h2>\n\n\n\n<p>\u52d5\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u542b\u3080\u30da\u30fc\u30b8\u3082\u9759\u7684\u306a\u30da\u30fc\u30b8\u3068\u3057\u3066CDN\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u6642\u306b\u30da\u30fc\u30b8\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3057\u3066\u6b21\u306e\u30a2\u30af\u30bb\u30b9\u3067\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u53e4\u3044\u30c7\u30fc\u30bf\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u305fHTML\u3092\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306b\u66f8\u304d\u8fbc\u3080\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u306a\u306e\u3067\u3001Lambda\u306f\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u66f8\u304d\u8fbc\u307f\u3078\u306f\u672a\u5bfe\u5fdc\u3067\u3059\u3057\u3001Frgate\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5206\u6563\u3057\u3066\u3057\u307e\u3044CDN\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4e57\u305b\u308b\u306e\u304c\u96e3\u3057\u3044\u306e\u3067\u3053\u306e\u6a5f\u80fd\u3092\u697d\u306b\u4f7f\u304a\u3046\u3068\u601d\u3063\u305f\u3089\u30c7\u30d7\u30ed\u30a4\u5148\u306fVercel\u4e00\u629e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ISR\u306e\u524d\u63d0<\/h2>\n\n\n\n<p><span style=\"color: #ff0000;\"><strong>\u3042\u308b\u7a0b\u5ea6\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308b\u30b5\u30a4\u30c8\u3067\u3042\u308b\u3053\u3068\u304c\u524d\u63d0\u6761\u4ef6<\/strong><\/span>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u306a\u305c\u306a\u3089\u30b5\u30a4\u30c8\u30c7\u30fc\u30bf\u306e\u66f4\u65b0\u304c\u30e6\u30fc\u30b6\u30fc\u30a2\u30af\u30bb\u30b9\u304c\u8d77\u70b9\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3055\u3059\u304e\u308b\u3068<span style=\"color: #ff0000;\"><strong>\u53e4\u3059\u304e\u308b\u30c7\u30fc\u30bf\u304c\u8868\u793a\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b(\u4f8b\u3048\u3070\u30011\u5e74\u3076\u308a\u306e\u30a2\u30af\u30bb\u30b9\u306a\u30891\u5e74\u524d\u306e\u60c5\u5831\u3002\uff08\u6700\u521d\u306e1\u56de\u306e\u30a2\u30af\u30bb\u30b9\u306f\u5fc5\u305a\u53e4\u3044\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u3066\u66f4\u65b0\u3055\u308c\u306a\u3044\u305f\u3081\u3002\uff09\u666e\u901a\u306f\u305d\u3093\u306a\u53e4\u3044\u60c5\u5831\u306f\u898b\u305b\u305f\u304f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002)<\/strong><\/span>\u305f\u3081\u3067\u3059\u3002\u305d\u308c\u306a\u308a\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308b\u3053\u3068\u304cISR\u5c0e\u5165\u306e\u524d\u63d0\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">revalidate<\/h2>\n\n\n\n<p>Next.js\u306b\u304a\u3051\u308bHTML\u518d\u751f\u6210\u306e\u30a4\u30f3\u30bf\u30fc\u30d0\u30eb\u306e\u6642\u9593\u3067\u3059\u3002\u4f8b\u3048\u3070\u30015\u79d2\u306a\u3069\u3068\u8a2d\u5b9a\u3057\u305f\u5834\u5408\u306f5\u79d2\u3054\u3068\u306bHTML\u304c\u518d\u751f\u6210\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fcA\u304c\u30b5\u30a4\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u969b\u306b\u3001DB\u304c\u65b0\u3057\u3044\u60c5\u5831\u306b\u306a\u3063\u3066\u3044\u305f\u5834\u5408\u306f\u518d\u751f\u6210\u304c\u884c\u308f\u308c\u307e\u3059\u304c\u30015\u79d2\u306e\u9593\u306f\u3044\u308d\u3093\u306a\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u4f55\u5ea6\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308d\u3046\u304c\u518d\u751f\u6210\u304c\u884c\u308f\u308c\u307e\u305b\u3093\u3002\u305d\u3046\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u30b5\u30fc\u30d0\u30fc\u8ca0\u8377\u3092\u4f4e\u6e1b\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u88c5\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u5b9f\u88c5\u306f\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002\u305d\u3093\u306a\u306b\u899a\u3048\u308b\u3053\u3068\u3082\u306a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>getStaticProps\u306e\u623b\u308a\u5024\u306e\u7b2c\u4e8c\u5f15\u6570\u306brevalidate\u3067\u30a4\u30f3\u30bf\u30fc\u30d0\u30eb\u306e\u6642\u9593\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export async function getStaticProps() {\n  const staticfilterdTasks = await getAllTasksData();\n\n  return {\n    props: { staticfilterdTasks },\n    revalidate: 3,\n  };\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">getStaticProps<\/h3>\n\n\n\n<p>\u3053\u308c\u5358\u4f53\u3060\u3068\u9577\u671f\u9593\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u308b\u9759\u7684\u30da\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002\uff08SSG\uff09<\/p>\n\n\n\n<p>revalidate\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u305d\u306e\u9759\u7684\u30da\u30fc\u30b8\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3068\u3044\u3046\u6319\u52d5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"ISR(Incremental Static Regeneration)\u3068\u306f\uff1f \u30e6\u30fc\u30b6\u30fc\u30a2\u30af\u30bb\u30b9\u3092\u8d77\u70b9\u3068\u3057\u3066\u52d5\u7684\u306b\u9759\u7684\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u66f4\u65b0\u3057\u3066\u304f\u308c\u307e\u3059\u3002 \u300cStale while revalidation\u300d\u3068\u8a00\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u304c [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[119],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13448"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13448"}],"version-history":[{"count":9,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13448\/revisions"}],"predecessor-version":[{"id":22876,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13448\/revisions\/22876"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13448"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}