【问题标题】:asp.net apache2/nginx OutputCache problemasp.net apache2/nginx 输出缓存问题
【发布时间】:2011-05-16 03:34:07
【问题描述】:

我对 web.config 文件中的输出缓存设置有疑问。 我在 openSuse 11.3 上使用 Nginx 0.8.53 和 Fast CGI

对于动态页面,我创建了 OutputCacheProfiles,它们在 windows 中的 Visual Studio 环境中完美运行。当我请求一个页面时,它带有正确的缓存控制标头。但是当我在 openSuse 上使用 Nginx 时,无论我在 OutputCacheProfiles 中设置什么,它都会不断发送“Cache-Control public,max-age=0”。我试过apache2,它似乎也没有像nginx一样响应outputcacheprofile设置。

一切都在 Windows 环境下完美运行,我为不同浏览器中的不同页面获得了正确的缓存控制标头。但是当我使用 apache 或 nginx 时,它似乎没有响应我在 web.config 文件中的 outputcacheprofiles。 我删除了指令及其内容,它仍然在响应中添加了 max-age=0。 希望我解释了情况。 最好的问候。

<caching>
  <outputCache enableOutputCache="true" />
  <outputCacheSettings>
    <outputCacheProfiles>
        <add name="MatchesController.Index" duration="5" varyByParam="*" varyByCustom="utcOffset" location="ServerAndClient" enabled="true" noStore="true"/>
        <add name="MatchesFeedController.Index" duration="5" varyByParam="*" varyByCustom="utcOffset" location="ServerAndClient" enabled="true" noStore="true"/>
        <add name="MatchesFeedController.IncidentsSummary" duration="5" varyByParam="*" location="ServerAndClient" enabled="true"/>
        <add name="MatchesController.Show" duration="60" varyByParam="*" varyByCustom="utcOffset" location="ServerAndClient" enabled="true"/>
        <add name="MatchesController.Preview" duration="60" varyByParam="*" varyByCustom="utcOffset" location="ServerAndClient" enabled="true"/>
        <add name="MatchesController.Live" duration="60" varyByParam="*" varyByCustom="utcOffset" location="ServerAndClient" enabled="true"/>
        <add name="MatchesController.TeamStats" duration="60" varyByParam="*" varyByCustom="utcOffset" location="ServerAndClient" enabled="true"/>
    </outputCacheProfiles>
  </outputCacheSettings>
</caching> 

【问题讨论】:

    标签: asp.net linux mono nginx outputcache


    【解决方案1】:

    听起来更像是一个单声道错误,而不是 nginx/apache 问题。使用 mono 时,尝试使用 mono 附带的 xsp 网络服务器来托管您的应用程序,而不使用 nginx 或 apache,并检查 Cache-Control 标头的结果。如果它们被错误地设置为public, max-age=0,即使两者之间没有 nginx/apache,这可能是单声道中的错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多