lamp安装mod_concat模块

发布于 分类 Apache

更新于 2015-10-14

lamp安装mod_concat模块合并css/js,减少请求提高页面整体加载速度

mod_concat模块,用于合并多个文件在一个响应报文中。请求参数需要用两个问号('??')例如:

http://example.com/??style1.css,style2.css,foo/style3.css
更多详情请阅读本文尾部的参考资料。

测试环境centos6.5

安装 apxs, apache 模块的编译工具
# yum install httpd-devel
下载mod_concat模块解压并切换到mod_concat.c所在目录以便稍后编译安装
https://github.com/kryton/modconcat/archive/master.zip
编译 modconcat ( -c 代表 compile -i 代表 install -a 代表自动添加载入该模块的语句)
# apxs -i -a -c mod_concat.c
重启apache服务生效
# service httpd restart
用法demo(举1反3):
http://www.yourdomain.com/optional/path/??file1.js,file2.js,dir3/file3.js
http://www.yourdomain.com/optional/??dir1/file.js,dir2/file2.js

-- The End --

本文标题: lamp安装mod_concat模块

本文地址: https://seonoco.com/blog/lamp-install-mod-concat-module

本页面显示内容已针对移动端进行优化,点击查看完整版本