Skip to content

Commit d1e665c

Browse files
committed
Update docs about versioning and images
1 parent 8f51639 commit d1e665c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ A straightforward static asset uploader which versions files by their contents
44
and generates a json file for your application to read the uploaded file
55
locations from.
66

7+
## Versioned files and Images
8+
9+
`.js` and `.css` files are versioned during upload using a hash of the file's
10+
contents as to allow for cache-busting.
11+
12+
Images and other files are *not* versioned to allow for maximum caching and due
13+
to their contents not changing very often like `.css` and `.js` files do.
14+
715
## Usage
816

917
Ensure your AWS credentials environment variables are set (`AWS_ACCESS_KEY_ID`,
@@ -30,7 +38,7 @@ Usage of buffer-static-upload:
3038
For example, you can use glob patterns to match multiple sets of files:
3139

3240
```
33-
buffer-static-upload -files "public/js/**/*.js,public/css/*.css" -bucket my-bucket
41+
buffer-static-upload -files "public/js/**/*.js,public/css/*.css,public/img/*.*" -bucket my-bucket
3442
```
3543

3644
This will generate a `staticAssets.json` file in this directory like this:
@@ -39,7 +47,8 @@ This will generate a `staticAssets.json` file in this directory like this:
3947
{
4048
"public/css/style.css": "https://my-bucket.s3.amazonaws.com/public/css/style.11985b07e3121564a73d4d6821bfcfe7.css",
4149
"public/js/x/another.js": "https://my-bucket.s3.amazonaws.com/public/js/x/another.bfa2d0f60841707efe7be0a94c4caacf.js",
42-
"public/js/script.js": "https://my-bucket.s3.amazonaws.com/public/js/script.d55002b60fcfff0b3d355184d23af6f7.js"
50+
"public/js/script.js": "https://my-bucket.s3.amazonaws.com/public/js/script.d55002b60fcfff0b3d355184d23af6f7.js",
51+
"public/img/home.jpg": "https://my-bucket.s3.amazonaws.com/public/img/home.jpg",
4352
}
4453
```
4554

0 commit comments

Comments
 (0)