Skip to main content
Learn how VectoriaDB manages cache invalidation and when re-indexing occurs.

How Invalidation Works

VectoriaDB validates the cache on initialize() by checking:
  1. Cache exists: Does the storage have cached data?
  2. Tools hash matches: Has the document content changed?
  3. Version matches: Has the application version changed?
  4. Model matches: Is the embedding model the same?
If any check fails, the cache is invalidated.

Configuration

src/cache-config.ts

Tools Hash

Create a deterministic hash of your documents:
src/tools-hash.ts
The tools hash should change whenever your documents change. Use SerializationUtils.createToolsHash() to generate it automatically.

Version Invalidation

Invalidate cache on deployments:
src/version-invalidation.ts

Manual Cache Control

Force Re-index

src/force-reindex.ts

Check Cache Status

src/check-cache.ts

Warm-up Pattern

Common pattern for production deployments:
src/warmup.ts

Debugging Cache Issues

src/debug-cache.ts

Error Handling

src/cache-errors.ts

Storage Overview

Storage fundamentals

File Adapter

File storage

Deployment

Production setup