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


创新互联建站是一家专注于网站建设、
成都网站设计与策划设计,建昌网站建设哪家好?
创新互联建站做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:建昌等地区。建昌做网站价格咨询:18980820575
安装包优化,转移到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 修改成自己要的时间。
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站题目:Apache网页优化之缓存-创新互联
文章转载:
http://cxhlcq.cn/article/jpcdc.html