Next.js

Keep Affiliate Prices Fresh in Next.js with ISR (Without Breaking Amazon's Rules)

By SK · runs 20+ affiliate sites·11 min read·Updated 2026-07-28

A page can rank well, read well, and still quietly lose money because the price on it is wrong. Stale prices and sold-out items are one of the most common hidden reasons a high-traffic affiliate page underperforms — visitors lose trust and bounce, and your EPC sags. For Amazon, a stale price isn't just a conversion problem; it's a compliance breach. Here's how to keep affiliate data fresh in Next.js the right way.

Freshness is an EPC lever

Treat price freshness as an optimisation, not a chore. When you rank pages by EPC, some of the underperformers won't need a rewrite — they'll need a current price and an in-stock product. A visitor who sees "$49.99" and lands on a $79 product detail page doesn't convert, and they don't come back. Fresh data protects the conversion you already earned the traffic for.

The Next.js ISR toolkit

Incremental Static Regeneration lets you serve static-fast pages that refresh their data in the background. Three pieces cover almost every case in the App Router.

Time-based, per route. Set a revalidate interval on the segment and Next.js re-renders in the background at most that often:

// app/deals/[slug]/page.tsx
export const revalidate = 3600; // seconds

Time-based, per fetch. Scope freshness to the specific data call, and tag it for later:

const res = await fetch(priceApiUrl, {
  next: { revalidate: 3600, tags: ["prices"] }
});

On-demand. When a price actually changes, refresh immediately from a route handler or server action — triggered by a program webhook or a cron job — instead of waiting for the interval:

// app/api/revalidate/route.ts
import { revalidateTag } from "next/cache";

export async function POST() {
  revalidateTag("prices");
  return Response.json({ revalidated: true });
}

The pattern: render the page statically, pull prices from the program's API, and let ISR keep them current without a full redeploy. For most non-Amazon programs that's the whole story — pick a sensible interval (daily is often plenty), tag your price fetches, and wire an on-demand refresh for big changes.

The Amazon rules you must respect

Amazon is stricter, and getting this wrong turns your "fresh price" automation into a policy violation. The rules that matter for a Next.js build:

Match Next.js revalidate to Amazon's caching windowsSet revalidate to Amazon's cache windowAmazon contentAllowed caching windowYour Next.js ISRPrices & availabilityCache ≤ 1 hour (Creators API)revalidate ≤ 3600Titles & descriptionsCache ≤ 24 hoursrevalidate ≤ 86400Product imagesDon't store — hotlink onlyno ISR cacheAlways show a retrieval timestamp + link to the product page.No API access (needs 10 sales / 30 days)? Don't display prices — use "Check price on Amazon".
Amazon prices must come from the live API and can only be cached within Amazon's windows — so your Next.js revalidate interval has to sit at or below them. Get this wrong and automated "fresh" prices become a compliance breach. Windows per Amazon's Associates operating policies (Creators API replaces PA-API after May 2026).
  • Prices must come from the live API. Amazon's Product Advertising API — being replaced by the Creators API after May 15, 2026 — is the only compliant source. Scraped, hardcoded, or remembered prices are prohibited outright.
  • Respect the caching window. Non-image product content could be cached up to 24 hours under PA-API; the Creators API tightens prices and availability to roughly one hour, after which you must refresh and re-display. Your revalidate for Amazon price data must sit at or below that window — so revalidate = 3600 or less for prices, not a daily interval.
  • Show a timestamp and link out. Any displayed price needs a retrieval timestamp and a disclaimer along the lines of "Price and availability as of [time]; the price at purchase applies," plus a link to the product detail page. Our disclosure generator can help with the surrounding disclosure.
  • No API access? Don't show prices. API access requires 10 qualifying sales in the trailing 30 days per marketplace. Without it, omit the number and use a "Check price on Amazon" button — compliant, never stale, and usually fine for conversion since the goal is the click-through.

A safe pattern, end to end

For a comparison or review page that shows Amazon prices: fetch them server-side from the API, set revalidate at or below one hour, render the price with its retrieval time and disclaimer, and link every product to its detail page. If you'd rather not manage the API and its sales requirement, skip the number entirely and render dynamic "Check price" buttons — the same approach the /go redirect pattern already uses for click tracking.

For other programs that permit longer caching, lean on daily ISR plus an on-demand revalidateTag("prices") webhook so a price drop shows up in seconds without a rebuild.

Then close the loop: watch whether fresh data moves EPC on the pages you touched. Pair this with first-party analytics and you can see the conversion lift directly, rather than guessing that "prices matter."

See if stale data is costing you: Clickolytics ties clicks to revenue per page, so a page whose EPC dropped points you straight at the culprit — often a price that went stale. See how it works →

Frequently asked questions

How do I keep affiliate prices current in Next.js? Use ISR: fetch from the program's API and set a revalidate interval (route export or fetch next.revalidate) so pages refresh in the background. Add on-demand revalidateTag/revalidatePath via a webhook for instant updates.

Can I cache Amazon prices? Only from the live API and only within Amazon's window — up to 24h for non-image content under PA-API, roughly 1h for prices under the Creators API. Set revalidate at or below that, show a timestamp, and link to the product page.

No API access? Don't display Amazon prices — access needs 10 sales / 30 days per marketplace. Use "Check price on Amazon" buttons instead; compliant and never stale.

Does freshness affect earnings? Yes — a wrong price or sold-out item kills trust and conversion, dragging EPC. Stale data is a common hidden cause of an underperforming money page.

Related reading