Skip to main content

Caching

Use the template's Cache Components and optional Redis or Valkey backed cache handlers.

SectionApplication / Runtime
PurposeCaching reference
UpdatedJul 6, 2026
AuthorTemplate Maintainers
Versionv1.2.0
Reading time1 min

Caching

The template uses Next.js Cache Components and repository-level cache tags. It can run with a local fallback cache or a distributed Redis/Valkey-backed cache.

Local default

By default, REMOTE_CACHING_ENABLED=false. This keeps local development simple and uses the local fallback supplied by the custom cache handlers.

Distributed cache

Enable distributed cache storage when multiple application instances need to share Cache Components and ISR entries:

VariablePurpose
REMOTE_CACHING_ENABLEDEnables remote cache mode when set to true.
REDIS_URL or VALKEY_URLConnection URL for the cache service.
REDIS_PASSWORDOptional password when it is not already included in the URL.
REMOTE_CACHING_PREFIXPrefix that isolates cache entries per app or environment.

Use a unique prefix when sharing one Redis or Valkey service between environments.

Feature cache invalidation

Repository reads use cache tags. Mutations refresh affected tags and paths so the UI can show fresh workspace, account, team, invitation, and API key data.