This is primarily intended for including x-request-id ![]() Meaningfully vary the fetch response needs to be present in the Note that this will only be relevant when the cache.fetch()Ĭall needs to call fetchMethod(). ![]() fetchContextĪrbitrary data that can be passed to the fetchMethod as the For example, a DNS cache may update the TTLīased on the value returned from a remote DNS server by changing Will result in modifying the settings to t() when the The options object is a union of the options that may be This may be passedĪlong to async functions aware of AbortController/AbortSignal Means that the fetch should be abandoned. Signal.onabort method is called, or if it emits an 'abort'Įvent which you can listen to with addEventListener, then that If at any time, signal.aborted is set to true, or if the The global object, otherwise it's a pretty close polyfill. The signal object is an AbortSignal if that's available in If fetchMethod is not provided, then cache.fetch(key) isĮquivalent to Promise.resolve(cache.get(key)). Most of them can be // overridden for specific items in get()/set() const options = ). // All the other options are optional, see the sections below for // documentation on what each one does. // In most cases, it's best to specify a max for performance, so all // the required memory allocation is done up-front. Const LRU = require ( 'lru-cache' ) // At least one of 'max', 'ttl', or 'maxSize' is required, to prevent // unsafe unbounded storage.
0 Comments
Leave a Reply. |