Skip to main content

HTTP cache

Cache responses at the gateway so repeat requests never reach the app.

TypehttpCache
CategoryTraffic

Fields

FieldTypeRequiredDefaultDescription
maxTtlnumbernoLongest a response is kept, in seconds.
maxStalenumbernoHow long a stale entry may still be served while it refreshes.
memoryLimittextnoCap on the in-memory cache, e.g. 100MB. Example: 100MB.
cacheableStatusCodeslist of numbersnoResponse codes worth caching. Empty uses Goma's defaults. Example: 200.
excludedResponseCodeslist of textnoCodes or ranges to keep out of the cache, e.g. 5xx. Example: 5xx.
includeQueryInKeytrue/falsenoOff means /page?a=1 and /page?a=2 share one cached response.
queryParamsToCachelist of textnoRestrict the key to these parameters, so tracking parameters don't fragment the cache. Example: page.
disableCacheStatusHeadertrue/falsenoBy default Goma reports HIT/MISS on each response.
cachePrivateResponsestrue/falsenoOff by default: a request carrying an Authorization header or a cookie skips the cache entirely, since one shared entry would be served to every caller. On, each caller gets their own entry.