2.8.0 • Published 4 months ago

@ampproject/toolbox-update-cache v2.8.0

Weekly downloads
385
License
Apache-2.0
Repository
github
Last release
4 months ago

AMP-Toolbox update-cache

npm version

Generates AMP Cache invalidation URLs for all known AMP Caches. For more info see the Google AMP Cache documentation.

Usage

Install via:

npm install @ampproject/toolbox-update-cache@beta

Generate a list of update URLs like this:

  const UpdateCacheUrlProvider = require('@ampproject/toolbox-update-cache');

  // Load the private key, generated as described on 
  // https://developers.google.com/amp/cache/update-cache#rsa-keys
  const privateKey = '...';

  // Create an instance of the factory using the private key.
  const updateCacheUrlProvider = UpdateCacheUrlProvider.create(privateKey);

  updateCacheUrlProvider.calculateFromOriginUrl('https://www.example.com')
    .then(cacheUpdateUrls => {
      cacheUpdateUrls.forEach(cacheUpdateUrlInfo => {
        console.log('Cache ID:' + cacheUpdateUrlInfo.cacheId);
        console.log('Cache Name:' + cacheUpdateUrlInfo.cacheName);
        console.log('cache-update URL:' + cacheUpdateUrlInfo.updateCacheUrl);
      });
    });

Note: this only generates the URLs, but doesn't perform the actual update request.

3.0.0-canary.2

4 months ago

2.8.0

12 months ago

2.8.0-canary.15

1 year ago

2.8.0-canary.9

1 year ago

2.8.0-canary.6

1 year ago

2.8.0-canary.4

1 year ago

2.8.0-canary.2

1 year ago

2.8.0-canary.0

1 year ago

2.7.6

1 year ago

2.7.5

1 year ago

2.7.4

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

2.7.1-alpha.0

1 year ago

2.7.0-alpha.1

2 years ago

2.6.0

2 years ago

2.5.6

2 years ago

2.5.4

2 years ago

2.5.1

2 years ago

2.5.0

2 years ago

2.4.0-alpha.1

2 years ago

2.4.0-alpha.0

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

2.0.0-alpha.4

2 years ago

2.0.0-alpha.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.0-beta.1

3 years ago

1.1.0-beta.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-beta.9

3 years ago

1.0.0-beta.8

3 years ago

1.0.0-beta.7

3 years ago

1.0.0-beta.6

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-beta.4

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.1

3 years ago

1.0.0-beta.0

3 years ago