简体   繁体   English

gzip无法在内部CSS和javascript上运行

[英]gzip not working on internal css and javascript

I followed this link to gzip my php driven website It's working fine but what happened is I checked my website in this link http://gzipwtf.com/ and as well as checked it in web developer toolbar in mozila whether css and javascripts are gzipped or not, I found only external css and javascripts are gzipped while internal css and javascripts are not gzipped. 我按照此链接将gzip驱动到了我的PHP驱动的网站,它工作正常,但是发生了什么事,我在此链接http://gzipwtf.com/检查了我的网站,并在mozila的Web开发人员工具栏中检查了css和javascript是否已压缩不论是否,我发现仅外部css和javascript被压缩,而内部css和javascript没有被压缩。 I have no idea what went wrong. 我不知道出了什么问题。

UPDATE: 更新:

Internal CSS and javascript such as http://www.myserver.com/style.css are not gzipped while external css and javascipt such as https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js are gzipped. 内部CSS和javascript(例如http://www.myserver.com/style.css未压缩,而外部CSS和Javascipt(例如https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js被压缩。

The jQuery JS is loaded from Google's servers, which gzips it. jQuery JS是从Google的服务器加载的,然后对其进行gzip处理。 You need to configure your server to gzip the static files (JS/CSS) on your server. 您需要配置服务器以gzip压缩服务器上的静态文件(JS / CSS)。

Do a Google search on "[insert server name] gzip", and you'll probably find countless tutorials :) 用Google搜索“ [插入服务器名称] gzip”,您可能会发现无数的教程:)

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

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