Skip to content

Implement Next.js incremental cache handler backed by Harper table #48

@kriszyp

Description

@kriszyp

Add support for the Next.js incremental cache handler API (cacheHandler / incrementalCacheHandlerPath) implemented against a Harper table, so Next.js ISR/full-route-cache data is stored and invalidated via Harper rather than the default filesystem.

Why

  • Harper is already embedded alongside the Next.js app as a component.
  • Using Harper as the cache store enables distributed cache invalidation across cluster nodes, persistent cache across restarts, and faster cache lookups from local Harper data.

Implementation

A CacheHandler class implementing get(key), set(key, data, ctx), and revalidateTag(tag) backed by a Harper table. Configured via:

// next.config.js
module.exports = {
  cacheHandler: require.resolve('./harper-cache-handler'),
  cacheMaxMemorySize: 0, // disable in-memory cache
}

🤖 Filed by Claude on behalf of Kris.

Metadata

Metadata

Labels

enhancementNew feature or requestfrom-jiraMigrated or originated from a Jira ticket

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions