Skip to content

Commit

Permalink
Gzip nested server side rendered files
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansydnor committed Jan 6, 2017
1 parent 3b997cb commit 17cf509
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ function cleanup {
}
trap cleanup EXIT

rm -rf ssr
mkdir -p ssr
rm -rf ssr/

npm run generate-sitemap
npm run update-breweries
# npm run update-breweries
npm run build
npm run server
npm run scrape

# gzip swag
find build \( -iname '*.html' -o -iname '*.css' -o -iname '*.js' -o -iname '*.json' -o -iname '*.xml' -o -iname '*.txt' -o -iname '*.ico' \-o -iname '*.eot' -o -iname '*.ttf' -o -iname '*.woff*' \) -exec gzip -9 -n {} \; -exec mv {}.gz {} \;
find ssr/* -exec gzip -9 -n {} \; -exec mv {}.gz {} \;
gzip -9 -n ssr/index.html; mv ssr/index.html.gz ssr/index.html;
find ssr/**/* -exec gzip -9 -n {} \; -exec mv {}.gz {} \;

pip install --user awscli
aws s3 sync build/ s3://nycbrewerymap/ --content-encoding 'gzip' --cache-control max-age=172800 --delete
aws s3 sync ssr/ s3://nycbrewerymap/ --content-type 'text/html' --content-encoding 'gzip' --cache-control max-age=172800
Expand Down

0 comments on commit 17cf509

Please sign in to comment.