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网页优化之缓存
网页网址:
http://njwzjz.com/article/jssiip.html