如何验证Apache的缓存工作? [英] How do I verify Apache caching is working?

查看:205
本文介绍了如何验证Apache的缓存工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经添加了缓存指令,以我的httpd.conf文件,但无法找到如何验证它的实际缓存页面,并为他们服务的。我如何可以验证这一点?

我添加了缓存指令在服务器配置级别(不使用虚拟主机)为:

  CacheEnable盘/
CacheRoot的/ var /缓存
CacheDefaultExpire 360​​0


解决方案

您可以检查,如果你的Apache是​​真正的缓存内容或不被确认以下要点。


  1. 在/ var / cache目录的大小检查。它应该在一段时间后越来越大的大小的时候有打到你的Apache


  2. 您可以在日志检查,应该响应code 302,而不是200


如果你符合这两点那么就应该有工作mod_disk_cache模块。

I've added the cache directives to my httpd.conf file but cannot discover how to verify it's actually caching the pages and serving them up. How can I verify this?

I added the cache directives at the server config level (not using VirtualHost) as:

CacheEnable disk /
CacheRoot /var/cache
CacheDefaultExpire 3600

解决方案

You can check if your apache is really caching content or not by confirming below points.

  1. check size of /var/cache directory. It should be growing in size after some time when there is hit on your apache

  2. You can check in logs, there should response code 302 instead of 200.

If you match both these points then there should be working mod_disk_cache module.

这篇关于如何验证Apache的缓存工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆