Skip to content

Caching API Data

Guide to API caching strategy in Wappler, focused on freshness, request cost, and page-versus-server ownership.

Caching API data is a freshness decision, not just a speed feature

Caching helps when repeated API calls are expensive, slow, or rate-limited, but it only works well when you are explicit about how stale the data is allowed to become. The important question is not whether caching exists. It is whether the user can tolerate seeing a recently cached result instead of a brand-new request every time.

Lower request cost
Reduce repeated calls to expensive or rate-limited endpoints.
Faster page load
Reuse a recent result when that is good enough for the task.
Deliberate freshness
Choose how current the data must be before enabling cache.
Decide how fresh the data must be before you enable caching.
Treat volatile dashboards differently from slow-changing catalogs or reference data.
Document the reason for caching so later debugging has context.

A practical caching pattern starts with low-volatility or rate-limited data

Good early candidates include product catalogs from third-party feeds, location lists, exchange tables, or status endpoints that change on a schedule instead of every second. Those cases make the tradeoff obvious and let you choose cache settings confidently.

Start with data that users do not expect to change every moment.
Use shorter cache windows when freshness matters more than request cost.
If users must always see server-truth immediately, do not force caching just for speed.

Choose whether the cache belongs in the page layer or the server layer

Some caching lives naturally in API Data Source because the page owns the request. Other cases belong in Server Connect because the server owns authentication, aggregation, or shared reuse across multiple pages. Matching the cache to the layer that owns the contract keeps the architecture easier to reason about.

Page-owned cache
Use this when the page safely calls the API directly.
Server-owned cache
Use this when auth, normalization, or reuse belongs in Server Connect.
Architectural clarity
Cache where the contract is owned, not wherever the option is easiest to click.

Next steps

Use the related tours below to decide which layer should own the request and its cache settings.