Chinaunix

标题: varnish如何设置默认index不被缓存 [打印本页]

作者: ibelieveme    时间: 2012-07-23 16:53
标题: varnish如何设置默认index不被缓存
我使用的是varnish 做的缓存代理,发现一个问题,.PHP程序是不做缓存的,我访问测式www.xxx.com/index.php默认首页,没有被缓存正常,但是我访问www.xxx.com默认首页被缓存了,真是搞不明白

这是不加index.php访问的,命中被缓存了
  1. Request URL:http://olympics.nimads.com/
  2. Request Method:GET
  3. Status Code:200 OK
  4. Request Headersview source
  5. Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  6. Accept-Charset:GBK,utf-8;q=0.7,*;q=0.3
  7. Accept-Encoding:gzip,deflate,sdch
  8. Accept-Language:zh-CN,zh;q=0.8
  9. Cache-Control:max-age=0
  10. Connection:keep-alive
  11. Host:olympics.nimads.com
  12. User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.10 (KHTML, like Gecko) Chrome/20.0.1123.4 Safari/536.10
  13. Response Headersview source
  14. Accept-Ranges:bytes
  15. Age:8
  16. Connection:keep-alive
  17. Content-Encoding:gzip
  18. Content-Length:33
  19. Content-Type:text/html; charset=utf-8
  20. Date:Mon, 23 Jul 2012 08:49:43 GMT
  21. Server:nginx/1.2.0
  22. Vary:Accept-Encoding
  23. Via:1.1 varnish
  24. X-Cache:HIT You!
  25. X-Powered-By:PHP/5.3.6
  26. X-Varnish:140248434 140248138
  27. x-hits:1
复制代码
这是index.php访问的,不被缓存了
  1. Request URL:http://olympics.nimads.com/index.php
  2. Request Method:GET
  3. Status Code:200 OK
  4. Request Headersview source
  5. Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  6. Accept-Charset:GBK,utf-8;q=0.7,*;q=0.3
  7. Accept-Encoding:gzip,deflate,sdch
  8. Accept-Language:zh-CN,zh;q=0.8
  9. Connection:keep-alive
  10. Host:olympics.nimads.com
  11. User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.10 (KHTML, like Gecko) Chrome/20.0.1123.4 Safari/536.10
  12. Response Headersview source
  13. Accept-Ranges:bytes
  14. Age:0
  15. Connection:keep-alive
  16. Content-Encoding:gzip
  17. Content-Length:33
  18. Content-Type:text/html; charset=utf-8
  19. Date:Mon, 23 Jul 2012 08:52:09 GMT
  20. Server:nginx/1.2.0
  21. Vary:Accept-Encoding
  22. Via:1.1 varnish
  23. X-Cache:MISS Me!
  24. X-Powered-By:PHP/5.3.6
  25. X-Varnish:140254638
  26. x-hits:0
复制代码





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2