# @expo/entity-cache-adapter-local-memory

> Cross-request local memory cache adapter for @expo/entity

Latest version **0.67.0** (published 2026-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @expo/entity-cache-adapter-local-memory
pnpm add @expo/entity-cache-adapter-local-memory
yarn add @expo/entity-cache-adapter-local-memory
bun add @expo/entity-cache-adapter-local-memory
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.67.0 |
| Published | 2026-09-18 |
| First published | 2022-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 36.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Expo |
| Maintainers | ide, brentvatne, expoadmin, exponent, bycedric, kudochien, alanhughes, tsapeta, expo-bot, philpl, ccheever, wschurman |
| Keywords | entity |

## Links

- npm: https://www.npmjs.com/package/@expo/entity-cache-adapter-local-memory
- npm.io page: https://npm.io/package/@expo/entity-cache-adapter-local-memory

## Dependencies (1)

- [@expo/entity](https://npm.io/package/@expo/entity.md) ^0.67.0

## Recent versions

- 0.67.0 (latest) — 2026-09-18
- 0.66.0 — 2026-08-03
- 0.65.0 — 2026-07-10
- 0.64.0 — 2026-05-22
- 0.63.0 — 2026-04-03
- 0.62.0 — 2026-03-16
- 0.61.0 — 2026-03-12
- 0.60.0 — 2026-03-06
- 0.59.0 — 2026-03-03
- 0.58.0 — 2026-03-02
- 0.57.0 — 2026-02-28
- 0.55.0 — 2026-01-27
- 0.54.0 — 2026-01-21
- 0.53.0 — 2025-12-19
- 0.51.0 — 2025-11-21
- … 32 more at https://npm.io/package/@expo/entity-cache-adapter-local-memory/versions

## README

# `@expo/entity-cache-adapter-local-memory`

Cross-request [LRU](https://github.com/isaacs/node-lru-cache) cache adapter for `@expo/entity`. Use
this cache with caution - it is nonstandard. The cache is shared between requests in the node process.

Note: This uses version 6.0.0 of `node-lru-cache` since it the most tuned version for our use case (low TTL + LRU). Upgrading
to 7.x will cause high memory usage for the entity cache adapter use case since it allocates fixed-size data structures up front to tune for the non-TTL use case: https://github.com/isaacs/node-lru-cache/issues/208.

[Documentation](https://expo.github.io/entity/modules/_expo_cache_adapter_local_memory.html)

## Why NOT use this cache

Because this is an in-memory cache, cross-machine invalidation is not possible. Do not use this cache
if you have the following use cases:

- The objects stored are mutable
- Reading a stale object from the cache is not acceptable in your application
- Cross-machine invalidation is not possible

## Typical use cases

If your application sees many requests fetching the same objects, you can save a trip to your cache
cluster and backing datastore by using this in-memory cache. Here are some good use cases:

- The objects stored are mostly immutable, and reading a stale object for a short TTL is acceptable
- You have a low TTL setting in your cache

## Usage

During `EntityCompanionProvider` instantiation:

```typescript
export const createDefaultEntityCompanionProvider = (
  metricsAdapter: IEntityMetricsAdapter = new NoOpEntityMetricsAdapter()
): EntityCompanionProvider => {
  return new EntityCompanionProvider(
    metricsAdapter,
    {
      ...
    },
    {
      ['local-memory']: {
        cacheAdapterProvider: new LocalMemoryCacheAdapterProvider.getProvider(),
      },
    }
  );
};

```

---
_Source: https://npm.io/package/@expo/entity-cache-adapter-local-memory · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
