amp-toolbox-cache-list
amp-toolbox-cache-list
npm i amp-toolbox-cache-list
amp-toolbox-cache-list

amp-toolbox-cache-list

A collection of AMP tools making it easier to publish and host AMP pages.

by ampproject

1.2.0-alpha.2 (see all)License:Apache-2.0TypeScript:DefinitelyTyped
Categories:Node.js AMP
npm i amp-toolbox-cache-list
Readme

AMP-Toolbox Cache List

npm version

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

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

Usage

  const Caches = require('amp-toolbox-cache-list');

  // Lists known AMP Caches
  const caches = await new Caches().list();

  // Retrieves a specific AMP cache
  const googleAmpCache = await caches.get('google');