DALP caches successful responses to cacheable GET reads per caller and returns an ETag header identifying the exact response body. Send that tag back in If-None-Match on your next request for the same resource. When nothing changed, DALP returns 304 Not Modified with no body. When something changed, it returns 200 OK with the new body and a new tag.
A client that omits If-None-Match downloads the full response on every poll. To react to changes without polling, subscribe with webhooks.
Send a conditional request
Read the resource once and store the ETag header from the response. See Authentication and API keys for credentials.
curl -i "$DALP_API_URL/api/v2/tokens" \
-H "X-Api-Key: $DALP_API_KEY"HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: private, no-cache
ETag: "84e2cdb7a166d1671bc5e2abc1e78b59777dd1f863d3c5b05d09c2dd088444c2"
Vary: Accept-Encoding, X-Participant, X-Executor, X-Custody-Account-Id, X-Chain-Id, X-Network-Id, OriginThe route supplies Content-Type and its normal JSON body, CORS handling adds Origin to Vary, and the response cache sets the caching headers. Send the tag back on your next read of the same URL and query string:
curl -i "$DALP_API_URL/api/v2/tokens" \
-H "X-Api-Key: $DALP_API_KEY" \
-H 'If-None-Match: "84e2cdb7a166d1671bc5e2abc1e78b59777dd1f863d3c5b05d09c2dd088444c2"'HTTP/1.1 304 Not Modified
Cache-Control: private, no-cache
ETag: "84e2cdb7a166d1671bc5e2abc1e78b59777dd1f863d3c5b05d09c2dd088444c2"
Vary: Accept-Encoding, X-Participant, X-Executor, X-Custody-Account-Id, X-Chain-Id, X-Network-Id, OriginA 304 Not Modified carries no body, so reuse your stored copy. Different URLs or query strings produce separate responses.
If-None-Match follows four rules:
- Send one tag or a comma-separated list. DALP returns
304when any listed tag matches. *matches whenever the read has any current tagged response.- Comparison is strong, so weak tags starting with
W/never match. A proxy that weakensETagheaders forces full responses. - On an untagged read, DALP ignores
If-None-Matchand returns the normal response.
Poll with conditional requests
For a client that watches a resource, send If-None-Match on every poll and replace your stored copy only on 200:
- Make the first read and store the body with its
ETag. - On each poll, send the stored tag in
If-None-Match. - On
304, keep the stored body. - On
200, replace the stored body and tag with the new ones. - On any other status, handle the error per Errors and keep the stored pair.
On a 200 without an ETag, store the new body and drop the old tag so the next poll omits If-None-Match.
Use the SDK
The TypeScript SDK manages tags automatically. It stores up to 64 responses of at most 1 MiB each, sends If-None-Match on repeat reads of the same URL for the same organisation and participant, and turns 304 back into the stored body.
The SDK clears its cache when the organisation or X-Participant changes. If you switch identity through a separate authentication client, call dalp.. See Calling routes.
What a 304 means
A 304 on a cache-generated tag means the current response body is byte-for-byte identical to the body identified by your tag. Cache tags are SHA-256 hashes of the uncompressed body, so a resource that changes and changes back produces the same tag, and Accept-Encoding does not affect it.
When an operation sets its own ETag (such as a stored record version), DALP keeps that tag instead of hashing the body and matches If-None-Match against it. Treat every tag as opaque.
Which reads carry a tag
The response cache tags a read when all of these hold:
- The operation is a
GETread and not an event stream. Writes are never cached. - The operation has not opted out. Reads such as custody reconciliation and deposits opt out and return no tag.
- The request does not set
live=true. On reads that declarelive,live=truebypasses the cache. Do not add it to other routes because some reject unknown query parameters. - The response has a
2xxor3xxstatus, fits in 1 MiB, and is not streamed. Errors carry no cache tag. - The operation does not set
Cache-orControl: no- store no-cache, a cookie, or anAuthorizationheader. - DALP can resolve the active participant from
X-Participant, or the read returns the same result for every participant. - The request URL and caller identity together fit within 16 KiB.
- Response caching is enabled (the default). Self-hosted deployments can disable it with
CACHE_VERSIONED_ENABLED.
A read that skips the cache (for example, during a cache fault or failed read-your-writes catch-up) returns no cache tag. Treat an omitted ETag as a normal uncached read and store the body without a tag. Operations that set their own ETag still return it regardless of the response cache.
Browser apps can read ETag and send If-None-Match because the API allows and exposes both headers over CORS. A browser's native HTTP cache also revalidates tagged responses automatically.
Who shares a cached response
Cached responses are isolated per caller. The cache key combines the organisation, user, authentication method, platform role, organisation ownership, resolved network, participant, and X-Executor, X-Custody-Account-Id, X-Chain-Id, and X-Network-Id headers. It does not include asset roles or on-chain roles.
For participant-dependent reads, the key uses the resolved participant rather than the raw X-Participant header. Participant-independent reads (such as public configuration and enabled languages) key on the raw header without resolving the participant, unless the read writes an audit record. Keep one stored tag per caller and Vary header combination.
How fresh a cached read is
DALP invalidates cached responses when underlying data changes. By default, cached entries also expire five minutes after storage.
After you write, your subsequent reads wait up to a configurable catch-up window (60 seconds by default) so you never read stale data from before your own write. If catch-up cannot complete, the read bypasses the cache and returns no tag. Other callers see changes once invalidation runs.
Cache- tells clients they may store the response but must revalidate with If-None-Match before reusing it.
Next steps
- Pagination for query parameters that change the URL and cached response.
- Errors for responses a poll can receive besides
200and304. - Versioning and deprecation for API stability guarantees.
- Response caching in DALP 3.2 for the release note.