Skip to content

Commit

Permalink
added gzip support for json files
Browse files Browse the repository at this point in the history
  • Loading branch information
ebello committed Mar 29, 2012
1 parent 5ae52bc commit 10cfd93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _libs/aws_s3_sync.rb
Expand Up @@ -30,8 +30,8 @@
# add far future expires header for all images
%x[ $(which s3cmd) sync #{local} s3://#{s3_bucket}/#{s3_path} --exclude '*' --rinclude '.ico$|.jpg$|.png$|.gif$' --acl-public --add-header "Expires: Tue, 19 Jan 2038 03:14:07 GMT" ]

# add gzip headers for all html files
%x[ $(which s3cmd) sync #{local} s3://#{s3_bucket}/#{s3_path} --exclude '*' --rinclude '.html$' --acl-public --add-header "Content-Encoding: gzip" ]
# add gzip headers for all html and json files
%x[ $(which s3cmd) sync #{local} s3://#{s3_bucket}/#{s3_path} --exclude '*' --rinclude '.html$|.json$' --acl-public --add-header "Content-Encoding: gzip" ]

# upload anything else
%x[ $(which s3cmd) sync #{local} s3://#{s3_bucket}/#{s3_path} --rexclude '.html$|.css$|.js$|.ico$|.jpg$|.png$|.gif$' --acl-public ]
Expand Down
1 change: 1 addition & 0 deletions _libs/gzip_content.rb
Expand Up @@ -17,6 +17,7 @@ def compressible_type(ext)
'.js',
'.svg',
'.appcache',
'.json',
#'.txt',
#'.ttf',
#'.atom',
Expand Down

0 comments on commit 10cfd93

Please sign in to comment.