# @ampproject/toolbox-cache-list

> Lists AMP Caches

Latest version **2.10.1** (published 2024-06-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ampproject/toolbox-cache-list
pnpm add @ampproject/toolbox-cache-list
yarn add @ampproject/toolbox-cache-list
bun add @ampproject/toolbox-cache-list
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.10.1 |
| Published | 2024-06-14 |
| First published | 2019-06-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 458 |
| Author | AMPHTML Team |
| Maintainers | ampproject-admin, kristoferbaxter, jridgewell, choumx, amp-toolbox, fstanis, erwinmombay, samouri, caroqliu, rsimha, dvoytenko, patrickkettner, alanorozco, kdwan, ampprojectbot, esth |
| Keywords | amp, amp-toolbox, amp-cache |

## Links

- npm: https://www.npmjs.com/package/@ampproject/toolbox-cache-list
- Repository: https://github.com/ampproject/amp-toolbox
- Homepage: https://github.com/ampproject/amp-toolbox/tree/main/packages/cache-list
- Issues: https://github.com/ampproject/amp-toolbox/issues
- npm.io page: https://npm.io/package/@ampproject/toolbox-cache-list

## Dependencies (1)

- [@ampproject/toolbox-core](https://npm.io/package/@ampproject/toolbox-core.md) 2.10.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.10.1 (latest) — 2024-06-14
- 3.0.0-canary.2 (canary) — 2022-01-11
- 2.7.1-alpha.0 (alpha) — 2020-12-01
- 1.1.0-beta.0 (beta) — 2019-08-29
- 2.10.0 — 2024-06-13
- 2.9.0 — 2022-06-23
- 2.8.0 — 2021-05-31
- 2.8.0-canary.15 — 2021-03-30
- 2.8.0-canary.9 — 2021-03-22
- 2.8.0-canary.0 — 2021-02-12
- 2.7.4 — 2020-12-23
- 2.7.2 — 2020-12-15
- 2.7.1 — 2020-12-02
- 2.6.0 — 2020-08-10
- 2.5.4 — 2020-06-22
- … 24 more at https://npm.io/package/@ampproject/toolbox-cache-list/versions

## README

# AMP-Toolbox Cache List

[![npm version](https://badge.fury.io/js/%40ampproject%2Ftoolbox-cache-list.svg)](https://badge.fury.io/js/%40ampproject%2Ftoolbox-cache-list)

Lists known AMP Caches, as available at `https://cdn.ampproject.org/caches.json`.

By default, it uses a one-behind caching strategy to fetch the caches. This can be customised by
passing a custom fetch strategy to the constructor.

## Usage

Install via:

```
$ npm install @ampproject/toolbox-cache-list
```

List all known caches:

```
  const Caches = require('@ampproject/toolbox-cache-list');

  const allCaches = await Caches.list();
```

Which will return an array similar to:

```
[
  {
    "id": "google",
    "name": "Google AMP Cache",
    "docs": "https://developers.google.com/amp/cache/",
    "cacheDomain": "cdn.ampproject.org",
    "updateCacheApiDomainSuffix": "cdn.ampproject.org",
    "thirdPartyFrameDomainSuffix": "ampproject.net"
  },
  {
    "id": "bing",
    "name": "Bing AMP Cache",
    "docs": "https://www.bing.com/webmaster/help/bing-amp-cache-bc1c884c",
    "cacheDomain": "www.bing-amp.com",
    "updateCacheApiDomainSuffix": "www.bing-amp.com",
    "thirdPartyFrameDomainSuffix": "www.bing-amp.net"
  }
]
```

Fetching info about a specific AMP cache via the cache id:

```
  const Caches = require('@ampproject/toolbox-cache-list');

  const googleAmpCache = await Caches.get('google');
```

Which will return:

```
{
  "id": "google",
  "name": "Google AMP Cache",
  "docs": "https://developers.google.com/amp/cache/",
  "cacheDomain": "cdn.ampproject.org",
  "updateCacheApiDomainSuffix": "cdn.ampproject.org",
  "thirdPartyFrameDomainSuffix": "ampproject.net"
}
```

---
_Source: https://npm.io/package/@ampproject/toolbox-cache-list · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
