Skip to content
Discussion options

You must be logged in to vote

Short version: revalidateTag() / revalidatePath() only invalidate the Next.js cache on the container that received the request. Each Cloud Run replica has its own in-memory Data Cache / Full Route Cache — nothing is broadcast between them by default. What you're seeing is expected behavior of the default cache handler.

The clean fix on Cloud Run is a shared cache handler backed by Redis (Upstash / Memorystore) so all N replicas observe the same tag timestamps.

1. Install the shared handler

pnpm add @neshca/cache-handler @neshca/json-replacer-reviver

2. cache-handler.js at the repo root:

const { CacheHandler } = require("@neshca/cache-handler");
const createRedisHandler = require("@neshca/…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@rohith-goose
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by rohith-goose
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants