CachingConfig
Defined in: packages/middleware/src/caching.ts:20
Configuration for caching middleware.
Properties
Section titled “Properties”cacheStreaming?
Section titled “cacheStreaming?”
optionalcacheStreaming:boolean
Defined in: packages/middleware/src/caching.ts:49
Whether to cache streaming responses.
Default
Section titled “Default”falsekeyGenerator()?
Section titled “keyGenerator()?”
optionalkeyGenerator: (request) =>string
Defined in: packages/middleware/src/caching.ts:25
Cache key generator function.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”string
Default
Section titled “Default”Default implementation based on request hashmaxSize?
Section titled “maxSize?”
optionalmaxSize:number
Defined in: packages/middleware/src/caching.ts:37
Maximum cache size (number of entries).
Default
Section titled “Default”1000storage?
Section titled “storage?”
optionalstorage:CacheStorage
Defined in: packages/middleware/src/caching.ts:43
Cache storage implementation.
Default
Section titled “Default”InMemoryCacheStorage
optionalttl:number
Defined in: packages/middleware/src/caching.ts:31
Cache TTL in milliseconds.
Default
Section titled “Default”3600000 (1 hour)