Apache minify web page HTML source method
Apache format web page HTML source method
This is to remove the extra spaces in the source code of the webpage.
Reduce web page transmission data and speed up web page transmission
Add the following code to the.htaccess
file in the root directory of the website
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
💘 相关文章
- Apache 格式化网页HTML源码的方法
- apache非www重定向到www和https的代码
- Web page sharing to Twitter, Facebook with thumbnail function realization
- cloudflare 页面规则page-rules设置注意事项
- AppStore download fail ,use order page again
- 一个小清新,简洁优雅的新标签页面(New Tab page)插件Momentum
- mediawiki 在网站根目录下的apache/openlitespeed伪静态规则
- sublime text 3 快速格式化html代码的方法
- How to update the open source http3 server - openlitespeed