Skip to content

Commit

Permalink
Gzip JSON-LD file before uploading to server to save time.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Dec 30, 2019
1 parent 2a41299 commit 3dd1867
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import { PhylogenyWrapper, TaxonomicUnitWrapper } from '@phyloref/phyx';
import Vue from 'vue';
import { signer } from 'x-hub-signature';
import { saveAs } from 'filesaver.js-npm';
import zlib from 'zlib';
// Navigation controls.
import TopNavigationBar from './components/TopNavigationBar.vue';
Expand Down Expand Up @@ -544,7 +545,7 @@ export default {
Vue.nextTick(function () {
// Prepare request for submission.
const query = jQuery.param({
jsonld: outerThis.getPhylorefsAndPhylogenyAsOntology(),
jsonldGzipped: Buffer.from(zlib.gzipSync(outerThis.getPhylorefsAndPhylogenyAsOntology())).toString('base64')
}).replace(/%20/g, '+'); // $.post will do this automatically,
// but we need to do this here so our
// signature works.
Expand Down

0 comments on commit 3dd1867

Please sign in to comment.