Skip to main content
The Kolaria API does not do HTTP caching for you. Every response is sent with Cache-Control: private, no-store, and there are no ETag or Last-Modified headers, so conditional requests (If-None-Match) are not supported. Caching happens in your application, and this page describes how to do it safely for post data. When caching post data, include every query input that changes the result set in the cache key. For GET /v1/posts that means:
  • page
  • limit
  • sort
  • status
  • contentType
  • brandIdentityId
status, contentType and brandIdentityId are comma-separated lists in a single query parameter, for example status=draft,published. Repeating the parameter is not supported.

Cache key design

Treat each unique list query as its own cache entry.
Sorting array filters before building the key avoids duplicate cache entries for equivalent queries.
When status is omitted the API returns only published posts. Pass status=draft,published explicitly if you want both. The key above defaults an omitted status to published, so both spellings of the same query share one cache entry.
Use separate caches for:
  • post lists, keyed by pagination and filters
  • individual posts, keyed by postId
This keeps list pages independent while still letting you refresh a single post after PATCH /v1/posts/{postId}.

Invalidation rules

Invalidate caches whenever the underlying list order or membership can change.

After a post update

After PATCH /v1/posts/{postId} succeeds:
  • invalidate the individual post cache for that postId
  • invalidate all cached post lists, because title, slug, status and updated content can affect what users should see

After a new generated post becomes available

When a generation job (GET /v1/posts/generate/{jobId}) reports status: "completed" and a postId:
  • invalidate all cached post lists
  • optionally prefetch page 1 again if your UI shows newest posts first with sort=desc

After a delete

After DELETE /v1/posts/{postId}:
  • remove the individual post cache
  • invalidate all cached post lists so totalItems and page boundaries stay correct

Example with TanStack Query

The examples read KOLARIA_API_KEY for brevity. In a browser app, proxy these calls through your own backend so the key never ships to the client.

React and Next.js notes

If you use React Server Components or Next.js, React’s cache() function can help dedupe repeated reads during a single render on the server. Use it for read paths, but do not rely on it alone for mutation invalidation. Pair it with route-level revalidation, cache tags, or your client cache invalidation strategy after updates, deletes, or completed generation jobs.

Practical defaults

  • Use a short TTL for list caches if content changes frequently. Nothing in the response tells you it is stale.
  • Use explicit invalidation after update, delete, and successful generation completion.
  • Prefer sort=desc plus page-1 refetch if your UI is a newest-first feed.
  • Cache individual posts separately from paginated lists.
  • Apply the same pattern to GET /v1/feedback and GET /v1/projects/{projectId}/geo/scans, which paginate the same way. See Pagination.
Last modified on September 29, 2026