0.1.1 • Published 5 years ago

fast-purge v0.1.1

Weekly downloads
27
License
MIT
Repository
github
Last release
5 years ago

Akamai Fast Purge Utility

Node Plugin for using Akamai Fast Purge via EdgeGrid

Usage

const FastPurge = require('fast-purge');

const Purge = FastPurge.create({
    client_token: 'xxxxx',
    client_secret: 'xxxxx',
    access_token: 'xxxxx',
    host: 'xxxxx'
});

OAUTH PROPERTIES

For these values, please see Akamai documentation.

PropertyDescription
client_tokenclient_token in Akamai documentation
client_secretclient_secret in Akamai documentation
access_tokenaccess_token in Akamai documentation
hosthost in Akamai documentation

Methods

.submit()

Submit a cache purge to Akamai.

Purge.submit([ PURGE_OBJECTS ], [ PURGE_OPTIONS ])
    .then([ COMPLETE_HANDLER ])
    .catch([ ERROR_HANDLER ]);

PURGE_OBJECTS

(Array) Collection of content objects -- url, cpcode, or tag -- to invalidate or delete.

PURGE_OPTIONS

PropertyValuesDescription
operationinvalidate/delete(optional) default: invalidate
typeurl/cpcode/tag(optional) default: url
networkstaging/production(optional) default: production

Examples

Invalidate URLS:

Purge.submit([
    'https://www.your-website.com',
    'https://www.your-other-website.com/img/image.png'
]).then((data) => {
    console.log('purge complete!', data);
}).catch((err) => {
    console.log('something went wrong!', err);
});

Delete CPCODE:

Purge.submit([
    'S/L/4900/218742/1m30s/your-website-cpcode.html'
], {
    operation: 'delete',
    type: 'cpcode'
}).then((data) => {
    console.log('purge complete!', data);
}).catch((err) => {
    console.log('something went wrong!', err);
});
0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago