OptionaladapterCustom cache adapter for external storage backends.
Enables caching to Redis, IndexedDB, AsyncStorage, localStorage, etc. If omitted, uses in-memory MapCacheAdapter.
OptionalenabledEnable caching globally. Default: true
OptionalmethodsHTTP methods to cache. Default: ['GET']
OptionalrulesRoute-specific rules
OptionalserializerCustom serializer for generating cache keys
OptionalskipSkip caching based on request context. Return true to skip.
OptionalstaleTime until stale for SWR (ms). Default: undefined (no SWR)
OptionalttlDefault TTL for cached responses (ms). Default: 60000
Configuration for response caching.
Caching stores responses and returns cached values for identical requests, reducing API load and improving response times. Supports stale-while-revalidate (SWR) for background refresh.