唯一最好的工具可能是服务器端压缩.您可以使用mod_deflate在Apache中全局启用它.只需确保加载mod_deflate,并将其粘贴在httpd.conf文件的底部:
# mod_deflate for server-wide output compression.
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary
Run Code Online (Sandbox Code Playgroud)
然后,所有静态和动态内容将被压缩到支持它的浏览器.
其他现代网络服务器也支持这一点我敢肯定,您只需要查看他们的文档以了解如何启用它.
| 归档时间: |
|
| 查看次数: |
3236 次 |
| 最近记录: |