Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/426.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我们正在从.cache.html文件加载javascript,那么为什么我们不能从.js下载它呢?_Javascript_Gwt - Fatal编程技术网

我们正在从.cache.html文件加载javascript,那么为什么我们不能从.js下载它呢?

我们正在从.cache.html文件加载javascript,那么为什么我们不能从.js下载它呢?,javascript,gwt,Javascript,Gwt,在学习gwt时,我在developers.google.com上看到了以下句子 "The "`cache`" files contain your application's logic. If you were to look inside a `.nocache.html` file, you would see that it is JavaScript code wrapped in a thin HTML wrapper.You might wonder why the `GWT`

在学习gwt时,我在developers.google.com上看到了以下句子

"The "`cache`" files contain your application's logic. If you were to look inside a 
`.nocache.html` file, you would see that it is JavaScript code wrapped in a thin HTML
 wrapper.You might wonder why the `GWT` Compiler doesn't simply emit it as a JavaScript .js 
file. The reason for this is that certain browsers do not correctly handle compression of 
pure-JavaScript files in some circumstances. This would effectively mean that users 
unfortunate enough to be using such a browser would download the `.js` file uncompressed. "
我们正在从.cache.html文件加载
javascript

那为什么我们不能从.js下载呢?我认为现在所有支持
javascript

引用的声明似乎已经非常清楚地解释了这一点:“某些浏览器在某些情况下无法正确处理纯javascript文件的压缩”。不是关于支持JavaScript,而是关于支持JavaScript文件的压缩。

引用的声明似乎非常清楚地解释了这一点:“某些浏览器在某些情况下不能正确处理纯JavaScript文件的压缩”。它不是关于支持JavaScript,而是关于支持JavaScript文件的压缩。

。cache.html文件也有JavaScript,所以它不是压缩的?那么,为什么要将压缩的javascript存储在.js文件中呢?浏览器对待扩展名为.js和.html的文件有点不同。从缩小和模糊的意义上讲,这不是将压缩的js存储在文件中,而是缓存(从HTTP缓存的意义上说)服务器发送的文件应用了GZip或Deflate压缩..cache.html文件也有javascript,所以它没有被压缩?那么为什么要将压缩的javascript存储在.js文件中呢?浏览器对待扩展名为.js和.html的文件有点不同。这不是在文件中存储压缩的js,在缩小和模糊的意义上,而是在服务器发送文件时缓存(在HTTP缓存的意义上),并应用GZip或Deflate压缩。