Sync metadata cache
POST /api/v1/e/meta/syncHow sync works
Under normal operation, individual file metadata entries are cached in Valkey with a 1-hour TTL based on access patterns. This works well for most users, but when a user switches between apps frequently, the cache can become stale or fragmented. The sync endpoint performs a bulk synchronization. It takes all (or the most active) files for a user and pushes them into Valkey with a longer TTL in a single operation. This avoids the overhead of relying on individual cache hits.Sync types
Why
mostOne / mostTwo? Instead of making 15 separate cache hits for the 15 most active files, you make a single sync call to cache them all at once. This reduces endpoint hits and ensures the most accessed files are always warm in cache.Request body
string
required
The user ID whose files you want to sync.
string
required
The sync strategy. One of:
allOne, allTwo, mostOne, mostTwo.Example request
Example request
Response 200
number
Number of file metadata entries successfully synced to Valkey.
number
Number of entries skipped (e.g., due to the hard limit in
allTwo / mostTwo).Response 400
Returned when the sync would exceed the 450 MB hard limit (for allOne and mostOne types).
Response 404
Prefetch metadata
POST /api/v1/e/meta/prefetchRequest body
string
required
The user ID whose file metadata you want to prefetch.
number
required
Maximum number of files to prefetch. The service selects the most frequently queried files up to this limit.
Example request
Example request
Response 200
number
Number of file metadata entries pushed to cache.
Response 404
Invalidate metadata cache
POST /api/v1/e/meta/invalidateInvalidation types
Request body
string
required
The user ID whose cached metadata you want to invalidate.
string
required
Invalidation type. One of:
OUT, DEL.Example request - logout
Example request - logout
Example request - account deletion
Example request - account deletion
Response 200
string
The invalidation type that was executed (
OUT or DEL).number
Number of metadata entries removed.

