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

Added support for receiving JSON-LD files compressed with Gzip #63

Merged
merged 3 commits into from
Apr 20, 2020

Conversation

gaurav
Copy link
Member

@gaurav gaurav commented Dec 30, 2019

When I tried hosting JPhyloRef on my own server, I ran into extremely long upload times when uploading Brochu 2003 JSON-LD file (which is around 22mb in size) to JPhyloRef (~7 mins from Colorado to NYC). I managed to reduce this tremendously (to ~2 seconds) by allowing clients to upload JSON-LD files that had been compressed with gzip and then converted into a string as base64. This PR adds support for this on JPhyloRef's webserver: if a string is provided in the jsonldGzipped form field, it is converted from base64 into binary data and then uncompressed into a UTF-8 string for processing.

This should be merged after #62 has been merged.

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.

Sounds good in general. Is the reduction in time fully explained by the reduction in file size, or are you running into something else (firewall, packet sniffer, ...?). Also, assuming that jPhyloRef would always be proxied by a webserver (such as apache or nginx), wouldn't the fronting web server be able to transparently handle compression/decompression? (I.e., can't that be indicated through standard HTTP headers.)

@gaurav gaurav changed the base branch from make-work-on-octavian to master January 2, 2020 20:35
gaurav added a commit to phyloref/open-tree-resolver that referenced this pull request Jan 2, 2020
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
Copy link
Member Author

gaurav commented Apr 20, 2020

Also, assuming that jPhyloRef would always be proxied by a webserver (such as apache or nginx), wouldn't the fronting web server be able to transparently handle compression/decompression? (I.e., can't that be indicated through standard HTTP headers.)

Yes, they should! I couldn't figure out how in the time available before the January demo, but I've filed this as #64 and phyloref/klados#182 and will try to figure this out when we have more time.

Is the reduction in time fully explained by the reduction in file size, or are you running into something else (firewall, packet sniffer, ...?).

I think so, but I'll make a note in #64 to check on this in more detail.

@gaurav gaurav merged commit d6942ba into master Apr 20, 2020
@gaurav gaurav deleted the gzipped branch April 20, 2020 19:58
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