Apache网页优化之缓存
文章目录
一、Apache的网页缓存
Apache 的mod_expries 模块会自动生成页面头部信息中的 Express标签和 Cache-Control 标签。
客户端浏览器根据标签决定下次访问是在本地机器的缓存中获取页面,不需要再次向服务器发出请求,从而降低客户端的访问频率和次数,达到减少不必要的流量和增加访问速度的目的。
二、网页缓存配置
1、挂载共享文件,并解压到 /opt/目录下。

成都创新互联公司是一家专业提供延庆企业网站建设,专注与成都网站设计、成都网站制作、外贸网站建设、H5建站、小程序制作等业务。10年已为延庆众多企业、政府机构等服务。创新互联专业网站建设公司优惠进行中。
安装包优化,转移到http-2.4.2下面

2、安装编译工具

3、在 /opt/httpd-2.4.2 配置

4、make && make install
5、打开Apache的主配置文件,开启 expires 模块

修改域名和监听地址


开启expires模块

在文件末尾添加

验证apachen甚至是否成功

6、开启apache服务,关闭防火墙,并验证模块开启

win10验证:
在win10系统 安装抓包工具Fiddler。打开 Fiddler4,同时用浏览器输入IP地址:192.168.220.137,访问测试网站

如果不要缓存时间这么长, 可以在主配置文件中 我们自己在末尾添加的那段命令中 ,把50 修改成自己要的时间。
名称栏目:Apache网页优化之缓存
分享地址:https://www.cdcxhl.com/article8/jssiip.html
成都网站建设公司_创新互联,为您提供建站公司、Google、营销型网站建设、虚拟主机、软件开发、网页设计公司
广告
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
创新互联