Discussion
  • JavaScript SEO
  • Technical SEO

On headless Next.js builds, where do you land between SSR, static generation with revalidation, and edge rendering when prices and stock change hourly?

Published 1 reply

Discussion starter: a technical SEO question, posted with an answer from Niraj Raut to open the thread. If you have dealt with this on a site, reply with what you saw, especially where it differs.

Disclosure: Niraj Raut, who posted this answer, runs the SEO consultancy linked at the end of it.

1 reply

  • admin
    Admin
    Original poster

    For most headless commerce builds where prices and stock change hourly, I land on cached, pre-rendered pages with on-demand revalidation triggered by the price and inventory systems, not on time-based revalidation alone and not on server rendering every request. That gives Googlebot and users fast, complete HTML, keeps origin load predictable when crawling spikes, and keeps the page in step with the Merchant Center feed within minutes rather than hours. Full server-side rendering earns its cost where prices are genuinely personalised or change minute to minute. Edge rendering helps only when the data it needs is also at the edge; otherwise it moves the compute closer to the user and the database further away.

    The search requirements are the same whichever mode you choose: the first HTML response should contain the product name, current price, availability, internal links and structured data; it should return the correct status code; and it should arrive quickly and reliably under crawl load. The rendering choice is about how you meet those requirements at your update frequency.

    Why the hourly change matters more for Merchant Center than for rankings

    Googlebot does not recrawl most product pages every hour, so a page being an hour stale rarely matters for organic ranking. What matters is agreement between the page and the feed. Google checks landing pages against Merchant Center data, and mismatched price or availability can lead to item warnings or disapprovals. If you use automatic item updates, Google can also adjust the feed from the structured data it finds on the page, which makes a stale page actively harmful. The question to ask of each rendering option is: when Google fetches this URL at a random moment, how likely is it to see a price that differs from the feed?

    How each option behaves

    Approach Freshness Speed and origin load Main risk
    Static generation with time-based revalidation Up to the revalidation window, and the first request after expiry still receives the stale page while a new one is built Very fast, low origin load A predictable mismatch window after every price change
    Static generation with on-demand revalidation Near real time, if the PIM, pricing and stock systems send events that purge the affected paths or tags Very fast, low origin load Missed or failed webhooks leave pages stale indefinitely unless a time-based fallback exists
    Server-side rendering per request Always current, subject to upstream caching Slower first byte, origin load scales with crawling Slow responses under crawl spikes, which can reduce crawl rate and hurt Largest Contentful Paint
    Edge rendering Depends on where the data lives Fast only if the data is cached at the edge Each render calls back to a single-region database, adding latency instead of removing it
    Static shell with price and stock fetched in the browser Current for users Fast shell Price and availability missing from the server HTML and from JSON-LD unless Google renders the page; mismatch risk with the feed

    The setup I would default to

    1. Render product and category pages statically or from the framework’s data cache. In the Next.js App Router that means cached fetches or cached components tagged by product ID and category.
    2. Revalidate on events. When the pricing engine or inventory system changes a product, call a revalidation endpoint that invalidates the tags for that product and the categories it appears in. Newer Next.js releases also support partial prerendering, which keeps a static shell and renders a small dynamic section in the same response; it is worth evaluating for price and stock blocks if your version supports it well.
    3. Keep a time-based fallback. A revalidation window of an hour or a few hours catches the events that fail. Monitor webhook failures and alert on them.
    4. Render JSON-LD from the same data as the visible price, in the same render, so the two can never disagree.
    5. Handle status codes explicitly. Discontinued products should return a 404 or 410, or a 301 to a close replacement, and that change needs to invalidate the cached page. A cached 200 for a product that no longer exists is a soft 404 waiting to happen. For temporarily out-of-stock products, keep the 200 and mark availability as out of stock.

    Watch for this:

    Stale-while-revalidate means the request that triggers regeneration gets the old page. On a large catalogue, many of those requests are Googlebot, because it hits long-tail URLs that users rarely visit. Time-based revalidation alone therefore hands Googlebot a disproportionate share of stale pages. Event-driven invalidation avoids this.

    When full server rendering is the right answer

    • Prices depend on the user: trade accounts, member pricing or regional pricing resolved at request time. Even then, the default price for anonymous visitors, which Googlebot sees, should match the feed.
    • Flash sales or auctions where the price changes within minutes and a cached page would be wrong more often than right.
    • Catalogues small enough that origin load is not a concern.

    If you server-render, put a CDN cache in front with short TTLs for anonymous traffic and watch server response time in the Crawl Stats report. A rising average response time during crawl peaks is the early warning that Google may slow crawling.

    When edge rendering makes sense

    Edge rendering helps when the data it needs is replicated close to the edge: a key-value store updated on price change, or a globally distributed database. It also suits light personalisation such as currency or language chosen from location. If every edge render has to call a pricing API in one region, you have added a network hop to every request, and some edge runtimes also restrict Node APIs your data layer may depend on.

    How to verify the choice in production

    • Log the cache status and age header on requests from verified Googlebot. The share of Googlebot hits served a page older than the last price change is your freshness metric for search.
    • Track Merchant Center price and availability mismatch issues over time. A falling count after moving to event-driven revalidation is the clearest proof it works.
    • Use URL Inspection’s live test on a product just after a price change to confirm what Google receives.
    • Watch Crawl Stats for response time and host status during large catalogue updates.
    • Check field Largest Contentful Paint for product templates in Chrome UX Report data, split by mobile and desktop.

    Hypothetical example:

    A retailer with 150,000 products uses static generation with a 24-hour revalidation window. Merchant Center shows persistent price mismatches, mostly on long-tail products. Logs show a large share of Googlebot requests receiving pages generated before the last price change. Moving to tag-based revalidation triggered by the pricing engine, with a six-hour fallback, cuts the mismatch count without increasing origin load, because only changed products are regenerated.

    Pre-render by default, invalidate on events, fall back on time, server-render only where the price genuinely depends on the request, and treat edge rendering as a data-placement decision rather than a rendering one.

    Need help with this on your own site?

    Niraj Raut works with businesses in Nepal, Australia, the UK, Europe and the US on technical SEO, ecommerce SEO, local SEO and AI search.

    See SEO services

Add a reply

Replies are open to approved members. Log in or apply to join.