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:
- force github pages add
content-encoding: gzipheader.jsonfile, or - 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
Post a Comment