$ npm install @envelop/validation-cache
@envelop/validation-cacheThis plugins adds simple LRU caching to your validate, to improve performance by caching the validation result.
This plugins improves performance of validating by ~50% (based on benchmarks).
yarn add @envelop/validation-cache
import { envelop } from '@envelop/core';
import { useValidationCache } from '@envelop/validation-cache';
const getEnveloped = envelop({
plugins: [
// ... other plugins ...
useValidationCache({
// options goes here
}),
],
});
maxSet this to configure your maximum amount of items in the LRU cache. The default is 1000.
ttlSet this to configure the TTL (time to live) of items in the LRU cache. The default is 3600000.
© 2010 - cnpmjs.org x YWFE | Home | YWFE