简体   繁体   English

javascript中的chrome中的本机gzip解压缩

[英]native gzip decompression in chrome in javascript

Is it possible in chrome to decompress a file and read the content in js in a native way, Not via javascript itself. 是否有可能在chrome中解压缩文件并以本机方式读取js中的内容,而不是通过javascript本身。 I need to decompress a big file in the browser and doing this in javascript is really buggy and slow. 我需要在浏览器中解压缩一个大文件,并在javascript中执行此操作真的很麻烦而且很慢。 I know it is possible to deliver gzipped html and css files to the browsers. 我知道可以将gzip压缩的html和css文件传递给浏览器。 is it possible to do the same with files that are loaded into javascript via ajax? 是否可以对通过ajax加载到javascript的文件执行相同的操作?

is it possible to do the same with files that are loaded into javascript via ajax? 是否可以对通过ajax加载到javascript的文件执行相同的操作?

Yes, ajax requests are treated like every other HTTP requests and the responses will be decompressed automatically. 是的,ajax请求被视为与其他所有HTTP请求一样,并且响应将自动解压缩。 You just have to send the same appropriate Content-Encoding headers. 您只需发送相同的Content-Encoding标头即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM