Invalidate by tag from the code that changed the data
Time-based revalidation means stale data for up to the interval. Tag-based means the cache is fresh the moment the write happens.
// when caching
cacheTag(`post:${slug}`);
// in the server action that edits the post
revalidateTag(`post:${slug}`);Name tags by entity and id. A mutation knows exactly which entity it touched, so it knows exactly which tags to clear.
nextjscaching