2010-11-26 177 views
2

我有关于web.config文件中的outputcache设置的问题。 我正在使用Nginx 0.8.53和Fast CGI,在openSuse上使用11.3asp.net apache2/nginx OutputCache问题

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

在Windows环境下,一切都可以正常工作,我在不同的浏览器中为不同的页面获得正确的缓存控制标题。但是当我使用apache或nginx时,它似乎没有响应web.config文件中的outputcache配置文件。 我删除了其内容的指令,它仍然在响应中添加了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> 

回答

0

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