【问题标题】:What is RequestCacheLevel.BypassCache internally?内部的 RequestCacheLevel.BypassCache 是什么?
【发布时间】:2011-05-19 14:52:43
【问题描述】:

RequestCacheLevel.BypassCache 上的 documentation 并没有详细说明使用 HttpWebRequest 设置它的内部工作。我对此有一些疑问:

  • 这是指什么缓存?
  • 此设置是否添加任何 cache control 标头?
  • 这与设置标题的NoCacheNoStoreReload 相比如何?
  • 如果我想(尽可能从客户端)确保内容不是来自缓存,这是最佳选择吗?

【问题讨论】:

    标签: .net http caching httpwebrequest


    【解决方案1】:

    回答我自己的问题:

    • HttpWebRequest 确实使用了 IE 缓存,而RequestCacheLevel.BypassCache 正在引用该缓存。
    • 设置正在添加缓存控制标头
    • 相比NoCacheNoStore都避免缓存;但是,BypassCache 将加载到缓存中,因此如果您将来进行请求,它将在那里。 Reload 做了类似的事情,但标头允许代理从其缓存中返回,而 BypassCache 告诉代理也忽略其缓存。
    • 是的,这是最好的选择;)

    【讨论】:

      猜你喜欢
      • 2014-05-14
      • 2012-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-31
      • 2015-05-04
      相关资源
      最近更新 更多