Skip to main content

CacheManager

The CacheManager offers functionality to work with caches.

import { CacheManager } from '@archibald/core';

getInstance

This method gets the CacheManager instance from the SystemManager. If it doesn't exist it initializes a new CacheManager instance and sets it in the SystemManager.

import { CacheManager } from '@archibald/core';

const cacheManger = CacheManager.getInstance();

set

This method sets a cache in the CacheManager.

import { CacheManager } from '@archibald/core';

CacheManager.set(PARAMETERS);

Parameters

NameTypeDescription
keystringA unique identifier for the cache.
valueGeneric, defaults to BaseCacheA cache to be stored in the CacheManger class.

get

This method returns a cache for the specified key.

import { CacheManager } from '@archibald/core';

const cache = CacheManager.get(PARAMETERS);

Parameters

NameTypeDescription
keystringA unique identifier for the cache.

has

This method checks if a cache key exists in the cache.

import { CacheManager } from '@archibald/core';

const isInCache = CacheManager.has(PARAMETERS);

Parameters

NameTypeDescription
keystringA unique identifier for the cache.