phyloref / jphyloref

MIT License
0 stars 0 forks source link

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

Closed gaurav closed 4 years ago

gaurav commented 4 years ago

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.

gaurav commented 4 years ago

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 https://github.com/phyloref/klados/issues/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.