Skip to main content
Version: 5.9

MemoryCacheAdapter

Implements

  • CacheAdapter

Index

Constructors

Methods

Constructors

constructor

  • new MemoryCacheAdapter(options: { expiration: number }): MemoryCacheAdapter
  • Parameters

    • options: { expiration: number }
      • expiration: number

    Returns MemoryCacheAdapter

Methods

clear

  • clear(): Promise<void>
  • Clears all items stored in the cache.


    Returns Promise<void>

get

  • get<T>(name: string): Promise<undefined | T>
  • Gets the items under name key from the cache.


    Type parameters

    • T = any

    Parameters

    • name: string

    Returns Promise<undefined | T>

remove

  • remove(name: string): Promise<void>
  • Removes the item from cache.


    Parameters

    • name: string

    Returns Promise<void>

set

  • set(name: string, data: any, origin: string, expiration?: number): Promise<void>
  • Sets the item to the cache. origin is used for cache invalidation and should reflect the change in data.


    Parameters

    • name: string
    • data: any
    • origin: string
    • optionalexpiration: number

    Returns Promise<void>

Page Options