1.2.0 • Published 7 years ago

aliyun-cdn-refresh v1.2.0

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

aliyun-cdn-refresh

Simplify Refresh and push interface for aliyun cdn api

const cdn = require('aliyun-cdn-refresh')({
    "accessKeyId": "YOUR_ALIYUN_CDN_ACCESS_KEY",
    "secretAccessKey": "YOUR_ALIYUN_CDN_ACCESS_SECRET",
    "endpoint": "https://cdn.aliyuncs.com",
    "timeout": 5000 // Request timeout in milliseconds for connecting phase and response receiving phase. Defaults to 5000, both are 5s. You can use timeout: 5000 to tell urllib use same timeout on two phase or set them seperately such as timeout: [3000, 5000], which will set connecting timeout to 3s and response 5s
});

To refresh CDN cache

cdn.refreshDir('http://yourcdndomain/img/');
cdn.refreshFile('http://yourcdndomain/img/1.png');
cdn.refreshFiles(['http://yourcdndomain/img/1.png', 'http://yourcdndomain/img/2.png']);

To push file into CDN cache

cdn.pushFile('http://yourcdndomain/img/1.png');
cdn.pushFiles(['http://yourcdndomain/img/1.png', 'http://yourcdndomain/img/2.png']);
1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago