AWS Amplify API
AWS Amplify Home
Options
All

- Public
- Public/Protected
- All

Inherited Externals Only exported
Menu

Cache Interface

### Hierarchy

- ICache

## Index

### Methods

- clear
- configure
- createInstance
- getAllKeys
- getCacheCurSize
- getItem
- removeItem
- setItem

## Methods

### clear

- clear(): void

- - Defined in cache/src/types/Cache.ts:28

  Remove all items from cache

  #### Returns void

### configure

- configure(config: CacheConfig): CacheConfig

- - Defined in cache/src/types/Cache.ts:40

  change current configuration

  #### Parameters

  - ##### config: CacheConfig

  #### Returns CacheConfig

### createInstance

- createInstance(config: CacheConfig): ICache

- - Defined in cache/src/types/Cache.ts:37

  create a new instance with customized config

  #### Parameters

  - ##### config: CacheConfig

  #### Returns ICache

### getAllKeys

- getAllKeys(): string[] | Promise<string[]>

- - Defined in cache/src/types/Cache.ts:31

  Get all keys form cache

  #### Returns string[] | Promise<string[]>

### getCacheCurSize

- getCacheCurSize(): number | Promise<number>

- - Defined in cache/src/types/Cache.ts:34

  Get current size of the cache

  #### Returns number | Promise<number>

### getItem

- getItem(key: string, options?: CacheItemOptions): any

- - Defined in cache/src/types/Cache.ts:22

  Get item from cache

  #### Parameters

  - ##### key: string

  - ##### Optional options: CacheItemOptions

  #### Returns any

### removeItem

- removeItem(key: string): void

- - Defined in cache/src/types/Cache.ts:25

  Remove item from cache

  #### Parameters

  - ##### key: string

  #### Returns void

### setItem

- setItem(key: string, value: any, options?: CacheItemOptions): void

- - Defined in cache/src/types/Cache.ts:19

  Put item into cache

  #### Parameters

  - ##### key: string

  - ##### value: any

  - ##### Optional options: CacheItemOptions

  #### Returns void