求助:squid中refresh_pattern的配置问题

hellofox2000 2008-12-31 05:20:54


自己在虚拟机上搭建了redhat+squid环境,想对页面和图片做一些缓存,
因为原网站使用了url重写,此时访问html的http头是这样的:
(Status-Line) HTTP/1.1 200 OK
Cache-Control private
Content-Length 103073
Content-Type text/html; charset=utf-8
Date Tue, 30 Dec 2008 08:41:23 GMT
Server Microsoft-IIS/6.0
Set-Cookie onlineusercount=151; expires=Tue, 30-Dec-2008 08:44:23 GMT; path=/
Set-Cookie dnt=referer=showtopic.aspx%3ftopicid%3d199411%26page%3d1&oldtopic=D199411; domain=.xxx.com.cn; path=/
Set-Cookie dnt=referer=showtopic.aspx%3ftopicid%3d199411%26page%3d1&oldtopic=D199411; domain=.xxx.com.cn; path=/
X-AspNet-Version 2.0.50727
X-Powered-By ASP.NET.

也就是说将原来aspx页面映射成了html,但是这样的页面默认是不缓存的。

因此在squid里面进行了设置(每一行都单独设置过)
refresh_pattern –i \.html$ 0 20% 4320 ignore-private
refresh_pattern –i \.html$ 0 20% 4320 ignore-private ignore-reload
refresh_pattern –i http://bj.xxx.com.cn 0 20% 4320
refresh_pattern –i http://play.xxx.com.cn/defautl.html 0 20% 4320
refresh_pattern –i http://photo.xxx.com.cn/default.html 0 20% 4320
refresh_pattern –i http://play\.xxx\.com\.cn/default\.html 0 20% 4320

也将顺序从中间调到第一,原来是
refresh_pattern –i . 0 20% 4320
refresh_pattern –i \.html$ 0 20% 4320 ignore-private
后面变成了
refresh_pattern –i \.html$ 0 20% 4320 ignore-private
refresh_pattern –i . 0 20% 4320

但是squid好像对html仍然没有缓存,以下是接收到的头
(Status-Line) HTTP/1.0 200 OK
Cache-Control private
Connection keep-alive
Content-Length 46101
Content-Type text/html; charset=utf-8
Date Wed, 31 Dec 2008 08:23:41 GMT
Server Microsoft-IIS/6.0
Set-Cookie onlineusercount=18; expires=Wed, 31-Dec-2008 08:26:41 GMT; path=/
Set-Cookie lastolupdate=1000919187; path=/
Via 1.0 cache.xxx.com.cn (squid/3.0.STABLE1)
X-AspNet-Version 2.0.50727
X-Cache MISS from cache.xxx.com.cn
X-Powered-By ASP.NET


x-Cache仍然是MISS.
想请教大家一下,到底是哪出错了?

...全文
295 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cuijie_cn 2009-01-08
  • 打赏
  • 举报
回复
http://blog.s135.com/book/squid/

squid权威指南
Gdatasheet 2009-01-04
  • 打赏
  • 举报
回复
http://www.chinaunix.net/jh/38/115326.html

squid 配置
  • 打赏
  • 举报
回复
看不懂,帮顶吧

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧