> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# portalSqliteCache

> Cache EVM Portal responses with SQLite in Pipes SDK.

Create SQLite cache for Portal responses. Use with `evmPortalStream` to cache Portal API responses locally.

```ts theme={"system"}
portalSqliteCache(config: { path: string; compress?: boolean }): PortalCache
```

**Parameters:**

* `path`: Path to the SQLite database file. The parent directory is created if it does not exist.
* `compress`: Compress cached responses with zstd. Defaults to `true`.

**Example:**

```ts theme={"system"}
import { portalSqliteCache } from "@subsquid/pipes/portal-cache/node";
import { evmEventDecoder, evmPortalStream } from "@subsquid/pipes/evm";

const source = evmPortalStream({
  id: "cached-pipe",
  portal: "https://portal.sqd.dev/datasets/ethereum-mainnet",
  outputs: evmEventDecoder({ range: { from: 0 }, events: {} }),
  cache: portalSqliteCache({ path: "./cache.sqlite" }),
});
```

<Note>
  Import from `@subsquid/pipes/portal-cache/node` instead of `@subsquid/pipes/portal-cache`.
</Note>

### When to Use

* Development iteration
* Testing pipelines
* Repeated processing of same block ranges.


## Related topics

- [portalSqliteCache](/en/sdk/pipes-sdk/solana/reference/utility-components/sqlite-cache.md)
- [Pipes SDK 1.0](/announcements/pipes-sdk-1-0.md)
- [A prod-ready pipe](/en/sdk/pipes-sdk/solana/prod-ready-pipe.md)
- [Stateful transforms](/en/sdk/pipes-sdk/solana/guides/advanced-topics/stateful-transforms.md)
- [Bitcoin portal stream](/en/sdk/pipes-sdk/bitcoin/reference/basic-components/source.md)
