免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2702 | 回复: 3
打印 上一主题 下一主题

[proxy] [疑问]squid在原始服务器宕机时的反映 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-22 16:31 |只看该作者 |倒序浏览
我在学习squid的时候,配置后,能够正常访问,把原始服务器的web服务停止,那么再访问页面的时候,就会报错,我的理解,按常理,第2次访问这个网页的时候就会从cache力读取,但这种情况好像squid并没有缓存什么网页,每次还是要去原始服务器获取,这样怎么能达到缓存加速的作用呢?实在为这个疑惑烦恼,所以提出来,请大师们解惑。

  1. ERROR
  2. The requested URL could not be retrieved


  3. While trying to retrieve the URL: http://192.168.0.5/
  4. The following error was encountered:

  5. Unable to forward this request at this time.
  6. This request could not be forwarded to the origin server or to any parent caches. The most likely cause for this error is that:

  7. The cache administrator does not allow this cache to make direct connections to origin servers, and
  8. All configured parent caches are currently unreachable.
  9. Your cache administrator is webmaster@test.com.



  10. Generated Tue, 22 Apr 2008 08:27:46 GMT by localhost (squid/2.6.STABLE19)
复制代码

论坛徽章:
0
2 [报告]
发表于 2008-04-22 19:44 |只看该作者
这个是需要写在配置文件里面的. 类似这样的.

refresh_pattern -i .html 1440 100% 129600 reload-into-ims
refresh_pattern -i .shtml 1440 100% 129600 reload-into-ims
refresh_pattern -i .hml 1440 100% 4320 reload-into-ims
refresh_pattern -i .gif 1440 100% 4320 reload-into-ims
refresh_pattern -i .jpg 1440 100% 4320 reload-into-ims
refresh_pattern -i .swf 1440 100% 4320 reload-into-ims
#refresh_pattern -i .png 1440 100% 4320 reload-into-ims

论坛徽章:
0
3 [报告]
发表于 2008-04-23 11:09 |只看该作者
原来配置是,从网上克隆的:)
refresh_pattern . 0 20% 4320
我改成
refresh_pattern . 1440 100% 4320
把原始web关闭,确实照样访问,呵呵,谢谢!
不过,.css样式表文件和图片好像没有cache,网页样式和图片全没有了:(再研究研究!

[ 本帖最后由 jzccn 于 2008-4-23 11:12 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2008-04-26 10:24 |只看该作者
原帖由 jzccn 于 2008-4-23 11:09 发表
原来配置是,从网上克隆的:)
refresh_pattern . 0 20% 4320
我改成
refresh_pattern . 1440 100% 4320
把原始web关闭,确实照样访问,呵呵,谢谢!
不过,.css样式表文件和图片好像没有cache,网页样式和 ...


也取决于浏览器的行为.浏览器可能要求squid确认这个object是否fresh.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP