> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Persistent Cache Service

<Update label="3.6.1" description="2026-05-19">
  * Added: `KEYS_TTL_IN_SECS` now accepts a negative value (e.g. `-1`) to disable expiration on Redis cache entries, matching Redis's own no-expiry convention. Applies to all writes through the SQS-driven persistent-cache-service pipeline (entitlements, usage). Default behavior is unchanged when `KEYS_TTL_IN_SECS` is unset (7-day TTL). Purge/invalidation paths are unaffected — subscription migration continues to converge the cache. To get end-to-end no-expiry behavior, the same negative value must also be set on the reader side: `@stigg/node-server-sdk` v4.41.0+ (`redis.ttl: -1`) or sidecar-service v6.120.0+ (`REDIS_KEYS_TTL_IN_SECS=-1`).
</Update>

<Update label="3.2.0" description="2026-03-30">
  * Upgraded Stigg package dependencies and resolved security vulnerabilities.
</Update>

<Update label="3.1.1" description="2026-03-17">
  * Added support for caching credit entitlement data to enable low-latency credit balance retrieval via `getCreditEntitlement()`.
  * Fixed an issue with custom currency handling.
</Update>

<Update label="3.1.0" description="2026-02-25">
  * Migrated to modular cache packages (`@stigg/cache-core` and `@stigg/cache-redis-store`) for improved maintainability and extensibility.
</Update>

<Update label="3.0.4" description="2026-02-23">
  * Resolved a deployment workflow issue with the persistent cache service.
</Update>

<Update label="3.0.3" description="2026-02-18">
  * Upgraded `fast-xml-parser` dependency to resolve security vulnerability CVE-2026-26278.
</Update>

<Update label="3.0.0" description="2026-02-04">
  **Breaking change**: This version introduces a new Redis data structure for storing entitlement data. This change enables support for credit entitlements at high scale.

  <Warning>
    Once persistent-cache-service v3.0.0 writes data to Redis, older versions of `@stigg/node-server-sdk` and sidecar-service will not be able to read it correctly and will return incorrect entitlement data.
  </Warning>

  ### What changed

  * The Redis data structure now stores entitlements in a polymorphic format that supports both boolean and credit-based entitlements
  * Credit features are now properly linked to their credit entitlements

  ### Why this matters

  If you deploy persistent-cache-service v3.0.0 before upgrading all SDK/sidecar instances:

  * Older versions will misinterpret the new data structure
  * Entitlement checks may return incorrect results
  * This could affect your customers' access to features

  ### Migration steps

  You **must** follow this upgrade sequence:

  1. Upgrade your SDK or Sidecar to the minimum required versions (upgrade whichever you use):
     * `@stigg/node-server-sdk` → v4.12.1 or later
     * sidecar-service → v5.194.5 or later
  2. Deploy all updated services: ensure all SDK and/or sidecar instances are running the new version
  3. Deploy persistent-cache-service v3.0.0, **only after step 2 is complete**

  ### Migration considerations

  As part of this change, additional entitlement metadata is stored, which may result in increased Redis memory usage.

  We recommend monitoring Redis memory usage following the upgrade and adjusting your memory allocation accordingly — particularly in environments with large entitlement caches.
</Update>

<Update label="2.41.0" description="2025-11-23">
  * Added in-memory and persistent credit balance cache support to the SDK.
  * Credit balances now automatically update on grant and consumption events.
  * Entitlement evaluation uses the cached credit balance for faster checks.
</Update>
