Two settings on a resource protect your database and your bill: caching answers repeated reads from memory, and a rate limit stops one caller from hammering the table.

Response caching

With caching on, Pawabase keeps the answer to a list or get for a number of seconds and serves repeat requests without touching the database. Writes to the table clear its cache automatically. Studio: Settings → Cache responses. 0 turns caching off. Up to a day (86400 seconds).

What is safe to cache

Cache keys include the caller’s identity and the exact query, so one person never receives another’s cached answer. Access rules are still evaluated before a cached response is served.

Clear it

Writes through the API clear the table’s cache. Changes made outside the API (another service writing to the database) don’t; clear the cache yourself from a server:
SQL writes through the SQL editor clear the environment’s caches for you.

Browser caching for files

Buckets have their own cache_max_age for stored files. See Storage.

Rate limits

A rate limit allows each caller a number of requests to this table per window. Studio: Settings → Rate limit: Requests and Seconds (the window). Per caller, counted across all gateway instances. A caller is the signed-in user, or the address for anonymous requests. limit is required (the window defaults to 60 seconds). Over the limit, the API answers 429 with a Retry-After header; the client already retries politely and surfaces RateLimitError (retryAfter) if it keeps happening.

Which limit applies

There are several layers, from widest to narrowest:
  1. Who may call your API at all: allowed websites and server addresses, and each key’s own address and route limits (see Environment settings and API keys).
  2. Your plan’s request limits (see Usage & plan in Studio).
  3. This resource’s limit.
  4. Authentication’s own limits on sign-in and sign-up.
A request must pass all of them. Use the resource limit for tables that are expensive or abusable (search, exports, anything that sends email).

Choosing numbers

API keys

Limit a key by address and route.

Table settings

Where they live.