|
1 | 1 | # s3-site-cache-optimizer
|
| 2 | + |
| 3 | +Optimize a static website for hosting in S3, by including a fingerprint into |
| 4 | +all assets' filenames. The optimized website is uploaded into the specified S3 |
| 5 | +bucket with the right cache headers. |
| 6 | + |
| 7 | + |
| 8 | +## Usage |
| 9 | + |
| 10 | + usage: s3-site-cache-optimizer [-h] [--debug] [--version] |
| 11 | + [--exclude PATTERN [PATTERN ...]] |
| 12 | + [-o OUTPUT_DIR] |
| 13 | + [--access-key AWS_ACCESS_KEY_ID] |
| 14 | + [--secret-key AWS_SECRET_ACCESS_KEY] |
| 15 | + [--skip-s3-upload] |
| 16 | + source_dir destination_bucket |
| 17 | + |
| 18 | + positional arguments: |
| 19 | + source_dir Local directory containing a static website. |
| 20 | + destination_bucket Domain name of the website and S3 bucket name. |
| 21 | + |
| 22 | + optional arguments: |
| 23 | + -h, --help show this help message and exit |
| 24 | + --debug Enable debug output |
| 25 | + --version show program's version number and exit |
| 26 | + --exclude PATTERN [PATTERN ...] |
| 27 | + Exclude files and directories matching these patterns. |
| 28 | + -o OUTPUT_DIR, --output OUTPUT_DIR |
| 29 | + Output directory in which local files are written. |
| 30 | + When absent a temporary directory is created and used. |
| 31 | + --access-key AWS_ACCESS_KEY_ID |
| 32 | + AWS access key. If this field is not specified, |
| 33 | + credentials from environment or credentials files will |
| 34 | + be used. |
| 35 | + --secret-key AWS_SECRET_ACCESS_KEY |
| 36 | + AWS access secret. If this field is not specified, |
| 37 | + credentials from environment or credentials files will |
| 38 | + be used. |
| 39 | + --skip-s3-upload Skip uploading to S3. |
| 40 | + |
| 41 | +### Example |
| 42 | + |
| 43 | + $ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --access-key XXXXXAPPSTRAKTXXXXX --secret-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| 44 | + $ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --exclude ".git/*" ".git*" |
| 45 | + $ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --output ~/srv/example-optimized/ --skip-s3-upload |
| 46 | + |
| 47 | +--- |
| 48 | +Version 0.1 |
0 commit comments