Added response compression to data routes #196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR also helps to address #123 by reducing the response size returned by the Lambda API for the
/allbuildings
/data
and/batchData
routes.Previous to this PR, allbuildings had a response size of 167kb (167,451 bytes). With Brotli compression it's 3kb (3341 bytes).
This PR does require shifting these routes from using AWS's REST API calls to using AWS's HTTP API calls (both of them use http, the name difference is just how amazon distinguishes the services) which means we won't have any fancy AWS caching out-of-the-box, but I expect the speed-up from compression will overcome that particular deficiency.