> Source: https://www.gitdash.info/docs/caching · GitDash v4.7.1

# Caching & rate limits

Every GitHub token has an hourly budget (5,000 requests for most tokens). Dashboards fan out into many calls, so GitDash caches GitHub reads in layers and shows the remaining budget at the bottom of the sidebar.

## Layers

| Layer | What it does |
| --- | --- |
| In-memory (per instance) | Each GitHub route caches its result per token for its own lifetime — most for 5 minutes, fast-moving data for 15–60 seconds. Identical requests already in flight share one GitHub call. |
| Shared Postgres (api_cache) | With `DATABASE_URL` set, results are also stored in Postgres so every replica reuses them. Lookups give up after 300 ms and a failing database is bypassed, so the cache never slows a page down. `GITDASH_L2_CACHE=0` turns it off. |
| Browser | Responses are private to the signed-in user (`Vary: Cookie`); pages polled for live status are not browser-cached. |

Cache entries are keyed by a hash of the token, never the token itself, so one person's cached data — which reflects their private-repo access — is never served to someone else.

## Refresh

The refresh button in the top bar bypasses every layer and fetches live data from GitHub. Use it when you need a result from the last few minutes; otherwise the cache keeps the budget for everyone.

## Seeing where the budget goes

Set `GITDASH_GH_LOG=1` to log every GitHub call with the route that made it and the remaining budget. The server also warns once per token when the budget runs low.
