Skip to content

Commit 9a62992

Browse files
committed
Update file types to support xml, webp; change appstrakt to november five; update install instructions to install from pypi instead of source
1 parent 3007d75 commit 9a62992

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ bucket with the right cache headers.
1010
You can install the stable version using the following [pip](https://pip.pypa.io/en/latest/)
1111
command:
1212

13-
pip install --upgrade https://github.com/appstrakt/s3-site-cache-optimizer/archive/master.zip
13+
pip install --upgrade s3-site-cache-optimizer
1414

1515
If you want to keep up with the latest features, install the development version:
1616

17-
pip install --upgrade https://github.com/appstrakt/s3-site-cache-optimizer/archive/develop.zip
17+
pip install --upgrade https://github.com/novemberfiveco/s3-site-cache-optimizer/archive/develop.zip
1818

1919

2020
## Operation
@@ -49,15 +49,20 @@ file extensions are considered as _assets_:
4949
- jpeg
5050
- gif
5151
- js
52+
- xml
53+
- mp4
54+
- webm
55+
- webp
5256

5357
_Rewritables_ are text-based files with one of the following extensions:
5458

5559
- html
5660
- htm
5761
- js
5862
- css
63+
- xml
5964

60-
File a [feature request](https://github.com/appstrakt/s3-site-cache-optimizer/issues/new)
65+
File a [feature request](https://github.com/novemberfiveco/s3-site-cache-optimizer/issues/new)
6166
if you want to see other file extensions added.
6267

6368

@@ -107,7 +112,7 @@ if you want to see other file extensions added.
107112

108113
### Example
109114

110-
$ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --access-key XXXXXAPPSTRAKTXXXXX --secret-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
115+
$ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --access-key XXXXXNOVEMBERFIVEXXXXX --secret-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
111116
$ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --exclude ".git/*" ".git*" --region eu-west-1
112117
$ s3-site-cache-optimizer ~/srv/www.example.com www.example.com --output ~/srv/example-optimized/ --skip-s3-upload
113118
$ s3-site-cache-optimizer ~/srv/www.example.com my_bucket --domains www.example.com example.com --prefix "user/sites/www.example.com"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='s3-site-cache-optimizer',
5-
version='0.4',
5+
version='0.5.0',
66
license='MIT',
77

88
description='Optimize a static website before uploading to S3',

src/s3_site_cache_optimizer/optimize.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def __init__(self, source_dir, destination_bucket, exclude=[], output_dir=None,
109109
output_dir = mkdtemp()
110110

111111
self._assets_ext = ['.css', '.svg', '.ttf', '.woff', '.woff2', '.otf', '.eot', '.png',
112-
'.jpg', '.jpeg', '.gif', '.js', '.mp4', '.webm']
113-
self._rewriteables_ext = ['.html', '.htm', '.js', '.css']
114-
self._gzip_ext = ['.html', '.htm', '.css', '.js', '.svg']
112+
'.jpg', '.jpeg', '.gif', '.js', '.mp4', '.webm', '.webp']
113+
self._rewriteables_ext = ['.html', '.htm', '.js', '.css', '.xml']
114+
self._gzip_ext = ['.html', '.htm', '.css', '.js', '.svg', '.xml']
115115

116116
self._source_dir = source_dir
117117
self._output_dir = output_dir
@@ -337,7 +337,7 @@ def _gzip_files(self):
337337
if is_gzippable:
338338
tmp_handle, tmp_filename = mkstemp()
339339

340-
logger.debug('Gzipping {0}'.format(f))
340+
logger.debug('Gzipping {0}'.format(abspath))
341341
with open(abspath, 'rb') as f_in:
342342
with gzip.open(tmp_filename, 'wb') as f_out:
343343
f_out.writelines(f_in)

0 commit comments

Comments
 (0)