我有兴趣使用Firebase Hosting提供gzipped html/css/js文件.我尝试在firebase.json中设置Content-Encoding标头,但在部署时出错.
据称,您可以设置的唯一标头包括:Cache-Control,Access-Control-Allow-Origin,X-UA兼容,X-Content-Type-Options,X-Frame-Options,X-XSS-Protection
有什么想法吗?
默认情况下,Firebase Hosting已经压缩了所有文件.例如,这里是我在firebase上托管的css文件的响应头.注意Content-Encoding
标题:
Accept-Ranges:bytes Cache-Control:max-age=7178000 Connection:keep-alive Content-Encoding:gzip Content-Length:3483 Content-Type:text/css; charset=utf-8 Date:Sun, 10 Jan 2016 02:09:57 GMT ETag:"4c94283e07340e9cc0237fc2a349c94d" Last-Modified:Sun, 10 Jan 2016 00:10:31 GMT Server:nginx Strict-Transport-Security:max-age=31556926; includeSubDomains; preload Vary:Accept-Encoding Via:1.1 varnish X-Cache:HIT X-Cache-Hits:1 X-Powered-By:Express X-Served-By:cache-lax1432-LAX