thaliproject / postcardapp

A sample app to demonstrate how to build Thali applications
MIT License
22 stars 5 forks source link

Serve web app as compressed .gz files #96

Closed deadlyfingers closed 8 years ago

deadlyfingers commented 8 years ago

We could modify Express to serve the web app using gzip compression (if supported on target platforms)

yaronyg commented 8 years ago

We MUST turn this on. We are running over super constrained transports and it's a negotiation item anyway so if the client doesn't support it then nothing bad happens, we'll just default to not using GZIP.

mpodwysocki commented 8 years ago

@deadlyfingers @yaronyg there is already compression middleware out there https://github.com/expressjs/compression which is supported by the express organization

deadlyfingers commented 8 years ago

Also bodyparser middleware inflates deflated (compressed) bodies by default - https://github.com/expressjs/body-parser

deadlyfingers commented 8 years ago

Added compression node module to packages and app.js "The middleware will attempt to compress response bodies for all request that traverse through the middleware"

deadlyfingers commented 8 years ago

Will try verifying compression using Fiddler / Charles: https://www.telerik.com/download/fiddler https://www.charlesproxy.com/

deadlyfingers commented 8 years ago

Tested on localhost and Compression was 27.7% so that's a start.