Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Feature ID: PF-51
Version: 1.0
Last Updated: 2026-03-04
Status: ✅ Complete — 2026-03-05

Overview

This document describes how PF-51 (Caching Layer & Strategy) integrates with the platform. The caching layer provides a centralized, tenant-scoped cache for query results, configuration, and reference data. All cores consume it via the Platform Integration Layer (@/platform/cache); there are no cross-core dependencies.

Integration Pattern

Pattern Type: Platform Integration Layer (Pattern 1) PF-51 provides:
  • Caching service: get, set, delete, clear/invalidate with tenant-scoped keys
  • Cache hooks: useCachedQuery integrated with TanStack Query
  • Invalidation: Pattern-based and user-scoped invalidation; optional event-based invalidation
No events are published by PF-51. Other modules may call the cache invalidate API or subscribe to optional platform events for cache invalidation.

Public API

Location: src/platform/cache/
ExportPurpose
cacheServiceget, set, delete, clear, invalidate
useCachedQueryTanStack Query–backed cached query hook
Cache key formatorg-{orgId}:{namespace}:{key} (organization_id required)
See the spec specs/pf/specs/PF-51-caching-layer-strategy.md for full API Design and FR-1/FR-2/FR-3.

Consumer Cores

All cores may use @/platform/cache for:
  • Query result caching (via useCachedQuery or direct service)
  • Configuration caching (org settings, preferences)
  • Reference data caching (picklists, custom field definitions)
Tenant isolation: All cache keys MUST include organization_id. Helpers obtain/inject current org when callers omit it; missing org id causes validation failure.

Integration Matrix

This integration is referenced in:

References

  • Spec: specs/pf/specs/PF-51-caching-layer-strategy.md
  • Plan: specs/pf/plans/PF-51-caching-layer-PLAN.md (when created)