lamp安装mod_concat模块

NOCO发布于 分类 Apache

更新于 2015-10-14

2天前 有1个用户阅读过

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

本文是否有所帮助?
点赞 0
感谢支持
0
多谢反馈
评论 0
打赏

支持微信/支付宝

评论 ( 当前有 4 条评论 )

网友

最新最早
  • 网友2015-09-24 19:25:20
    虚拟空间有办法吗?
  • noco @ 楼上 2015-09-25 13:01:07
    可以试下PHP版的minify, 项目地址https://github.com/mrclay/minify
  • wang2016-12-14 14:56:54
    我下载了一个别人用C写的contacx.c 要怎么编译成so才能在linux 下的apache使用?
  • noco @ 楼上 2016-12-19 14:31:29
    apxs编译后加载so,重启启动配置