jquery - Can I serve gzipped JSON from GitHub Pages? -


i have json file on github pages, it's 2 mb uncompressed. access file via jquery's $.get() method. i'd gzip file, shrinks 500 kb, when put gzipped file on github pages, $.get() doesn't work error: uncaught syntaxerror: unexpected token

i think problem github pages doesn't set content-encoding: gzip header on json file, , request thinks it's dealing plain json file. there way either:

  1. force github pages add content-encoding: gzip header .json file, or
  2. configure ajax request knows it's dealing gzipped json file, though server hasn't told content zipped

github pages gziping html, css, js, json,... it's useless try better gziping json yourself.

a 1.3m json sent 357kb 1 github pages. see here , click on "load json" link.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -