AWS Amplify API
AWS Amplify Home
Options
All

- Public
- Public/Protected
- All

Inherited Externals Only exported
Menu

Initialization of the cache

### Hierarchy

- StorageCache
  - AsyncStorageCache
  - BrowserStorageCache
  - InMemoryCache

## Index

### Constructors

- constructor

### Properties

- cacheCurSizeKey
- config

### Methods

- configure
- fillCacheItem
- getModuleName

## Constructors

### constructor

- new StorageCache(config: CacheConfig): StorageCache

- - Defined in cache/src/StorageCache.ts:32

  Initialize the cache

  #### Parameters

  - ##### config: CacheConfig

    the configuration of the cache

  #### Returns StorageCache

## Properties

### Protected cacheCurSizeKey

cacheCurSizeKey: string

- Defined in cache/src/StorageCache.ts:31

### Protected config

config: CacheConfig

- Defined in cache/src/StorageCache.ts:32

## Methods

### configure

- configure(config?: CacheConfig): CacheConfig

- - Defined in cache/src/StorageCache.ts:128

  set cache with customized configuration

  #### Parameters

  - ##### Optional config: CacheConfig

    customized configuration

  #### Returns CacheConfig

  - the current configuration

### Protected fillCacheItem

- fillCacheItem(key: string, value: any | number | string | boolean, options: CacheItemOptions): CacheItem

- - Defined in cache/src/StorageCache.ts:101

  produce a JSON object with meta-data and data value

  #### Parameters

  - ##### key: string

  - ##### value: any | number | string | boolean

    the value of the item

  - ##### options: CacheItemOptions

    optional, the specified meta-data

  #### Returns CacheItem

  - the item which has the meta-data and the value

### getModuleName

- getModuleName(): string

- - Defined in cache/src/StorageCache.ts:44

  #### Returns string