验证码: 看不清楚,换一张 查询 注册会员,免验证
  • {{ basic.site_slogan }}
  • 打开微信扫一扫,
    您还可以在这里找到我们哟

    关注我们

Windows下怎么合并多个js和css提高网页加载速度

阅读:427 来源:乙速云 作者:代码code

Windows下怎么合并多个js和css提高网页加载速度

示例效果如下:

Windows下怎么合并多个js和css提高网页加载速度

mod_concatx模块是在mod_concat基础上修改的。

原有的mod_concat模块有很大的参考价值,但实际作用不大。

该模块存在以下三个问题:

1、每次都会重新向客户端发数据,没有合理利用浏览器缓存
2、存在安全漏洞,导致服务端程序被下载,比如"/??jquery.js,common.php"
3、合并每个文件时中间没间隔,导致内容粘连在一起,可能引起错误

所以我在mod_concat基础上写了mod_concatx模块,解决了前面提到的一些问题。

使用方法:



模块配置:

打开apache配置文件httpd.conf

loadmodule concatx_module modules/mod_concatx.dll

高级配置:(以下是默认配置,可以不配置)


concatxdisable off
concatxcheckmodified on
concatxseparator on
concatxmaxsize 1024
concatxmaxcount 10
concatxfiletype js,css

详细说明:

concatxdisable on/off//是否使用mod_concatx模块
concatxcheckmodified on/off//检查文件是否改动,建议on
concatxseparator on/off//合并文件时是否加换行分隔,建议on
concatxmaxsize 数字//合并文件总大小限制最大值,建议不要太大
concatxmaxcount 数字//合并文件总个数限制最大值,建议不要太大
concatxfiletype js,css//合并文件类型限制,如不限制填","
分享到:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: hlamps#outlook.com (#换成@)。
相关文章
{{ v.title }}
{{ v.description||(cleanHtml(v.content)).substr(0,100)+'···' }}
你可能感兴趣
推荐阅读 更多>