Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gzip JSON-LD file before uploading to server to save time #16

Merged
merged 2 commits into from
Jan 2, 2020

Conversation

gaurav
Copy link
Member

@gaurav gaurav commented Dec 30, 2019

When trying to host JPhyloRef on my own server, I found that files were being uploaded too slowly. This PR updates the Open Tree Resolver so that it uploads the file as a Gzipped string to save time. Requires a JPhyloRef that supports phyloref/jphyloref#63.

@gaurav gaurav marked this pull request as ready for review December 30, 2019 07:07
Copy link
Member

@hlapp hlapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only comment is whether there shouldn't also be an HTTP header set to indicate compressed data. Though that probably would only work if the entire request is compressed, not just some part of it?

@gaurav
Copy link
Member Author

gaurav commented Dec 31, 2019

@hlapp Exactly right! You're thinking of Content-Encoding, which indicates that the entire POST body is gzipped, but I couldn't figure out how to get that to work correctly on the NanoHTTPD server used by JPhyloRef. So, I opted to allow Base64/Gzipped form submission instead. Using Content-Encoding might be worth looking into if there was an simple way to gzip the entire AJAX request, but I don't think there is one, so this is probably easier to implement, since both Base64 and Gzip libraries are pretty widespread.

@gaurav gaurav merged commit dae71e0 into master Jan 2, 2020
@gaurav gaurav deleted the gzip-jsonld branch January 2, 2020 21:19
gaurav added a commit that referenced this pull request Jan 2, 2020
This PR upgrades all NPM packages to their latest version and publishes them to `/docs` for Github Pages. Changes from the last published version include:
- #16: Gzip JSON-LD files before uploading them to the JPhyloRef backend server.
- #17: Temporarily use my personal server as the backend while our UF server is down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants