https://github.com/fabioricali/staticbuster
Cache buster for static resources in HTML pages
https://github.com/fabioricali/staticbuster
cache cache-buster cachebuster cachebusting
Last synced: 3 months ago
JSON representation
Cache buster for static resources in HTML pages
- Host: GitHub
- URL: https://github.com/fabioricali/staticbuster
- Owner: fabioricali
- Created: 2017-12-07T22:05:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T21:03:27.000Z (over 7 years ago)
- Last Synced: 2025-03-13T22:07:56.170Z (3 months ago)
- Topics: cache, cache-buster, cachebuster, cachebusting
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## Installation
### Node.js
```
npm install staticbuster --save
```Imagine this scenario:
**index.html**
```html
```You may have cache problems! staticbuster adds a cache buster for each resource. For example:
```html
```## Usage
```javascript
const staticbuster = require('staticbuster');staticbuster({
file: 'path/index.html'
})
.then(() => console.log('ok'))
.catch(err => console.err(err));
```### Options
Name | Type | Default | Description
-|-|-|-
file | string or array of string | | File(s) to process
dest | string | | Optional, file destination
busterParam | string | _sb | Optional, buster param
busterValue | string | timestamp | Optional, buster value
saveCopy | boolean | true | Optional, save a copy### CLI
```
$ staticbuster --helpOptions:
-V, --version output the version number
-f, --file file to process
-d, --dest [destination] optional file destination
-b, --saveCopy [boolean] optional save a copy
-p, --busterParam [param] optional buster param, default is _sb
-v, --busterValue [value] optional buster value, default is the timestamp
-h, --help output usage information```
## Changelog
You can view the changelog here## License
staticbuster is open-sourced software licensed under the MIT license## Author
Fabio Ricali