UNPKG

apollo-server-caching

Version:

[![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

15 lines (13 loc) 469 B
/** Options for {@link KeyValueCache.set} */ export interface KeyValueCacheSetOptions { /** * Specified in **seconds**, the time-to-live (TTL) value limits the lifespan * of the data being stored in the cache. */ ttl?: number | null; } export interface KeyValueCache<V = string> { get(key: string): Promise<V | undefined>; set(key: string, value: V, options?: KeyValueCacheSetOptions): Promise<void>; delete(key: string): Promise<boolean | void>; }