apollo-server-caching
- Version 3.3.0
- Published
- 23.1 kB
- 1 dependency
- MIT license
Install
npm i apollo-server-caching
yarn add apollo-server-caching
pnpm add apollo-server-caching
Overview
[![npm version](https://badge.fury.io/js/apollo-server-caching.svg)](https://badge.fury.io/js/apollo-server-caching) [![Build Status](https://circleci.com/gh/apollographql/apollo-server/tree/main.svg?style=svg)](https://circleci.com/gh/apollographql/apoll
Index
Functions
function runKeyValueCacheTests
runKeyValueCacheTests: ( keyValueCache: KeyValueCache, tick?: (ms: number) => void) => Promise<void>;
Classes
class InMemoryLRUCache
class InMemoryLRUCache<V = string> implements KeyValueCache<V> {}
constructor
constructor({ maxSize, sizeCalculator, onDispose,}?: { maxSize?: number; sizeCalculator?: (value: V, key: string) => number; onDispose?: (key: string, value: V) => void;});
method delete
delete: (key: string) => Promise<void>;
method flush
flush: () => Promise<void>;
method get
get: (key: string) => Promise<V | undefined>;
method getTotalSize
getTotalSize: () => Promise<number>;
method jsonBytesSizeCalculator
static jsonBytesSizeCalculator: <T>(obj: T) => number;
method set
set: (key: string, value: V, options?: { ttl?: number }) => Promise<void>;
class PrefixingKeyValueCache
class PrefixingKeyValueCache<V = string> implements KeyValueCache<V> {}
constructor
constructor(wrapped: KeyValueCache<V>, prefix: string);
method delete
delete: (key: string) => Promise<boolean | void>;
method get
get: (key: string) => Promise<V | undefined>;
method set
set: (key: string, value: V, options?: KeyValueCacheSetOptions) => Promise<void>;
Interfaces
interface KeyValueCache
interface KeyValueCache<V = string> {}
interface KeyValueCacheSetOptions
interface KeyValueCacheSetOptions {}
property ttl
ttl?: number | null;
Package Files (5)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/apollo-server-caching
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/apollo-server-caching)
- HTML<a href="https://www.jsdocs.io/package/apollo-server-caching"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1089 ms. - Missing or incorrect documentation? Open an issue for this package.