1、Compress components with gzip 方法
默认认并没有开启gzip功能。需要修改apache的配置文件进行开启。
开启方法如下:
1. httpd.conf中打开deflate_Module和headers_Module模块(找到包含有deflate_Module和headers_Module去掉前面的“#”号 window下面的方法。)
2. httpd.conf最后面添加:
<IfModule deflate_module>
SetOutputFilter DEFLATE
# Don’t compress images and other
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:pdf|doc)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
2、
Add Expires headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A3600
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/plain A604800
ExpiresByType application/x-shockwave-flash A2592000
ExpiresByType video/x-flv A2592000
ExpiresByType application/pdf A2592000
ExpiresByType text/html A600
ExpiresByType image/x-icon A2592000
ExpiresByType application/javascript A604800
ExpiresByType text/css A604800
</IfModule>
3、Configure entity tags (ETags)
在网站的根目录找到.htaccess文件打开并添加以下代码
FileETag none