{"id":552315,"date":"2026-10-08T07:23:53","date_gmt":"2026-10-08T07:23:53","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=552315"},"modified":"2026-10-08T07:24:02","modified_gmt":"2026-10-08T07:24:02","slug":"optimize-next-js-caching-1-million-product","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/","title":{"rendered":"How We Optimized Next.js Caching for 1 Million Product"},"content":{"rendered":"\n<p>Running an eCommerce store with one million products creates a very different performance challenge from running a small catalog.<\/p>\n\n\n\n<p>Pages need to load quickly, product data needs to stay reasonably fresh, and the backend must handle traffic without processing the same requests repeatedly.<\/p>\n\n\n\n<p>While building a <a href=\"https:\/\/bagisto.com\/en\/headless-ecommerce\/\">headless Bagisto storefront<\/a> with Next.js, we needed a caching strategy that could scale with a large catalog without making deployments slower or putting unnecessary load on the backend.<\/p>\n\n\n\n<p>The solution was not a single caching technique. We combined request-level caching, cache tags, on-demand page generation, a small in-memory cache, and webhook-based revalidation.<\/p>\n\n\n\n<p>If you&#8217;re building a headless storefront, our guide on <a href=\"https:\/\/webkul.com\/blog\/how-to-build-ecommerce-in-next-js\/\">How to Build eCommerce in Next.js<\/a> covers the foundation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Challenge of a One-Million-Product Catalog<\/h2>\n\n\n\n<p>A large product catalog creates two problems that need to be solved together: <strong>performance and freshness<\/strong>.<\/p>\n\n\n\n<p>Pre-building every product page during deployment is not practical when the catalog contains one million products. Build times can increase significantly, and deployments become harder to manage.<\/p>\n\n\n\n<p>Fetching product data from the backend on every request creates a different problem. The backend has to process repeated requests for the same data, increasing server load and potentially increasing response times.<\/p>\n\n\n\n<p>Caching everything indefinitely is not the answer either. Product prices, inventory, availability, and content can change.<\/p>\n\n\n\n<p>The real challenge is finding the right balance between speed and freshness.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large wp-duotone-unset-1\"><img decoding=\"async\" width=\"1200\" height=\"800\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-1200x800.webp\" alt=\"text \" class=\"wp-image-552535\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-1200x800.webp 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-300x200.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-250x167.webp 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-768x512.webp 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching.webp 1536w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Why We Stopped Treating Cache as One Thing<\/h2>\n\n\n\n<p>Not all ecommerce data changes at the same frequency. Store configurations may remain unchanged for days.<\/p>\n\n\n\n<p>Product information can change a few times throughout the day. Cart and checkout data can change every second.<\/p>\n\n\n\n<p>Because of this, we moved away from a single caching strategy and started caching data based on how often it changes.<\/p>\n\n\n\n<p>This simple decision became the foundation of our entire optimization approach.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">One Entry Point for Every GraphQL Request<\/h2>\n\n\n\n<p>To keep caching consistent, every server-side GraphQL request goes through a single helper function.<\/p>\n\n\n\n<p>This helper wraps Next.js caching APIs and applies cache tags, cache keys, and cache lifetimes automatically.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">graphqlRequest( \nGET_PRODUCT_BY_URL_KEY, \n{ urlKey }, \n{ tags: [\"products\", `product-${urlKey}`],\n life: \"hours\",\n } );<\/pre>\n\n\n\n<p>This approach ensures every request follows the same caching rules.<\/p>\n\n\n\n<p>It also gives us one place to update caching behavior when requirements change.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why Cache Tags Matter<\/h3>\n\n\n\n<p>Cache tags allow us to invalidate specific content when data changes. Instead of clearing the entire cache, we can refresh only the affected product.<\/p>\n\n\n\n<p>This keeps cache invalidation fast and efficient.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Building Stable Cache Keys<\/h3>\n\n\n\n<p>A cache is only effective when identical requests generate identical keys. We generate cache keys using the GraphQL query and its variables in a stable, sorted format. As a result, duplicate requests always hit the same cache entry.<\/p>\n\n\n\n<p>For large catalogs, this significantly reduces unnecessary backend traffic.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Match Cache Lifetime to the Data<\/h2>\n\n\n\n<p>We assign cache durations based on how frequently data changes.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Human-friendly cache lifetimes\nseconds \u2192 10 s\nminutes \u2192 60 s  \nhours \u2192 3600 s\ndays \u2192 86400 s<\/pre>\n\n\n\n<p>Here is how we assign them across the catalog.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Data<\/th><th>Lifetime<\/th><\/tr><\/thead><tbody><tr><td>Store config, menus<\/td><td>days<\/td><\/tr><tr><td>Product pages<\/td><td>hours<\/td><\/tr><tr><td>Category listings<\/td><td>minutes<\/td><\/tr><tr><td>Search and filters<\/td><td>seconds<\/td><\/tr><tr><td>Cart, customer<\/td><td>never cached<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The rule is easy to remember. Cache for as long as the data stays true.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Generating Pages On Demand<\/h2>\n\n\n\n<p>The biggest optimization was avoiding the need to pre-build a million pages. We only generate a small set of popular products during deployment.<\/p>\n\n\n\n<p>All other product pages are generated when they receive their first visit.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">export const dynamic = \"force-static\";\nexport const revalidate = 86400;\nexport const dynamicParams = true;<\/pre>\n\n\n\n<p>This keeps build times fast regardless of catalog size.<\/p>\n\n\n\n<p>Once generated, pages are cached and served like static content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using a Small Memory Cache<\/h2>\n\n\n\n<p>The same product can be requested multiple times during a render cycle. To avoid duplicate requests, we use a lightweight LRU cache.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">const productCache =\n  new LRUCache&lt;ProductNode>(100, 10);<\/pre>\n\n\n\n<p>This reduces unnecessary backend calls while keeping memory usage predictable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Keeping Cached Content Fresh<\/h2>\n\n\n\n<p>Long cache times are only safe if you can clear them on demand.<\/p>\n\n\n\n<p>Bagisto sends a webhook whenever a product or collection changes.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if ( isProductUpdate || isCollectionUpdate ) \n{\n revalidatePath(\"\/\", \"layout\");\n }<\/pre>\n\n\n\n<p>This allows product updates to appear quickly without waiting for cache expiration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final Thoughts<\/h2>\n\n\n\n<p>Supporting one million products in Next.js does not mean building one million pages during every deployment or sending every request directly to the backend.<\/p>\n\n\n\n<p>Centralized caching, on-demand page generation, cache tagging, webhook revalidation, and strict handling of user data helped us keep the storefront fast while maintaining fresh content.<\/p>\n\n\n\n<p>For large <a href=\"https:\/\/bagisto.com\/en\/headless-ecommerce\/\">headless ecommerce<\/a> implementations, these patterns provide a practical way to scale Next.js without sacrificing performance or maintainability.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running an eCommerce store with one million products creates a very different performance challenge from running a small catalog. Pages need to load quickly, product data needs to stay reasonably fresh, and the backend must handle traffic without processing the same requests repeatedly. While building a headless Bagisto storefront with Next.js, we needed a caching <a href=\"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":770,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-552315","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How We Optimized Next.js Caching for 1 Million Product - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Learn how we optimized Next.js caching for a 1 million product Bagisto storefront using cache tags, on-demand page generation, ISR, webhooks, and smart cache lifetimes to improve performanc\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How We Optimized Next.js Caching for 1 Million Product - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how we optimized Next.js caching for a 1 million product Bagisto storefront using cache tags, on-demand page generation, ISR, webhooks, and smart cache lifetimes to improve performanc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-08T07:23:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-08T07:24:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-1200x800.webp\" \/>\n<meta name=\"author\" content=\"Ritu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ritu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/\"},\"author\":{\"name\":\"Ritu\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#\\\/schema\\\/person\\\/5e29ed784b7f9445c4e3ff7543bfa29f\"},\"headline\":\"How We Optimized Next.js Caching for 1 Million Product\",\"datePublished\":\"2026-10-08T07:23:53+00:00\",\"dateModified\":\"2026-10-08T07:24:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/\"},\"wordCount\":723,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/webkul.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/caching-1200x800.webp\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/\",\"url\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/\",\"name\":\"How We Optimized Next.js Caching for 1 Million Product - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/webkul.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/caching-1200x800.webp\",\"datePublished\":\"2026-10-08T07:23:53+00:00\",\"dateModified\":\"2026-10-08T07:24:02+00:00\",\"description\":\"Learn how we optimized Next.js caching for a 1 million product Bagisto storefront using cache tags, on-demand page generation, ISR, webhooks, and smart cache lifetimes to improve performanc\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdnblog.webkul.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/caching.webp\",\"contentUrl\":\"https:\\\/\\\/cdnblog.webkul.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/caching.webp\",\"width\":1536,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/optimize-next-js-caching-1-million-product\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/webkul.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How We Optimized Next.js Caching for 1 Million Product\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/webkul.com\\\/blog\\\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/webkul.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\\\/\\\/webkul.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdnblog.webkul.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\\\/\\\/cdnblog.webkul.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/webkul\\\/\",\"https:\\\/\\\/x.com\\\/webkul\",\"https:\\\/\\\/www.instagram.com\\\/webkul\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/webkul\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/webkul\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/webkul.com\\\/blog\\\/#\\\/schema\\\/person\\\/5e29ed784b7f9445c4e3ff7543bfa29f\",\"name\":\"Ritu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bc2529731debbaa3262752e12dd0beadbf918c5a3eb2461dc39f50e155236d9?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bc2529731debbaa3262752e12dd0beadbf918c5a3eb2461dc39f50e155236d9?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bc2529731debbaa3262752e12dd0beadbf918c5a3eb2461dc39f50e155236d9?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Ritu\"},\"description\":\"Ritu is a software engineer specializing in building modern, high-performance web applications with Next.js. With expertise in UI\\\/UX design and headless theme development, she creates fast, scalable, and user-centric digital experiences. Having contributed to numerous projects across different domains, she combines technical expertise with a strong design perspective to deliver seamless, responsive, and engaging web solutions.\",\"sameAs\":[\"https:\\\/\\\/in.linkedin.com\\\/in\\\/rituthakur03\\\/\"],\"url\":\"https:\\\/\\\/webkul.com\\\/blog\\\/author\\\/ritu-uxlab322\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How We Optimized Next.js Caching for 1 Million Product - Webkul Blog","description":"Learn how we optimized Next.js caching for a 1 million product Bagisto storefront using cache tags, on-demand page generation, ISR, webhooks, and smart cache lifetimes to improve performanc","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/","og_locale":"en_US","og_type":"article","og_title":"How We Optimized Next.js Caching for 1 Million Product - Webkul Blog","og_description":"Learn how we optimized Next.js caching for a 1 million product Bagisto storefront using cache tags, on-demand page generation, ISR, webhooks, and smart cache lifetimes to improve performanc","og_url":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2026-10-08T07:23:53+00:00","article_modified_time":"2026-10-08T07:24:02+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-1200x800.webp","type":"","width":"","height":""}],"author":"Ritu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ritu","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/"},"author":{"name":"Ritu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/5e29ed784b7f9445c4e3ff7543bfa29f"},"headline":"How We Optimized Next.js Caching for 1 Million Product","datePublished":"2026-10-08T07:23:53+00:00","dateModified":"2026-10-08T07:24:02+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/"},"wordCount":723,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-1200x800.webp","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/","url":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/","name":"How We Optimized Next.js Caching for 1 Million Product - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching-1200x800.webp","datePublished":"2026-10-08T07:23:53+00:00","dateModified":"2026-10-08T07:24:02+00:00","description":"Learn how we optimized Next.js caching for a 1 million product Bagisto storefront using cache tags, on-demand page generation, ISR, webhooks, and smart cache lifetimes to improve performanc","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2026\/08\/caching.webp","width":1536,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/optimize-next-js-caching-1-million-product\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How We Optimized Next.js Caching for 1 Million Product"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/5e29ed784b7f9445c4e3ff7543bfa29f","name":"Ritu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9bc2529731debbaa3262752e12dd0beadbf918c5a3eb2461dc39f50e155236d9?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9bc2529731debbaa3262752e12dd0beadbf918c5a3eb2461dc39f50e155236d9?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9bc2529731debbaa3262752e12dd0beadbf918c5a3eb2461dc39f50e155236d9?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Ritu"},"description":"Ritu is a software engineer specializing in building modern, high-performance web applications with Next.js. With expertise in UI\/UX design and headless theme development, she creates fast, scalable, and user-centric digital experiences. Having contributed to numerous projects across different domains, she combines technical expertise with a strong design perspective to deliver seamless, responsive, and engaging web solutions.","sameAs":["https:\/\/in.linkedin.com\/in\/rituthakur03\/"],"url":"https:\/\/webkul.com\/blog\/author\/ritu-uxlab322\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/552315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/770"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=552315"}],"version-history":[{"count":8,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/552315\/revisions"}],"predecessor-version":[{"id":560290,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/552315\/revisions\/560290"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=552315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=552315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=552315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}