开发者

asp.net apache2/nginx OutputCache problem

开发者 https://www.devze.com 2023-01-27 15:15 出处:网络
I have a problem regarding the outputcache settings in web.config file. I am using Nginx 0.8.53 with Fast CGI, on openSuse 11.3

I have a problem regarding the outputcache settings in web.config file. I am using Nginx 0.8.53 with Fast CGI, on openSuse 11.3

For dynamic pages, I created OutputCacheProfiles which are working perfectly on visual studio environment in windows. When I request a page, it comes with the correct cache-control header. But when I am working with Nginx on openSuse, it keeps sending "Cache-Control public, max-age=0" no matter what I set in OutputCacheProfiles. I tried apache2, it also seems to be not responding the outputcacheprofile settings as in nginx.

Everything works perfectly on windows environment, I get the correct cache-control headers for different pages in different browsers. But when I am using apache or nginx it seems to be not responding to my outputcacheprofiles in web.config file. I deleted directive with its content, it still adds that max-age=0 on responses. Hope I explained the situation. Best regards.

<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" varyByPar开发者_开发问答am="*" 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> 


Sounds more like a mono bug than an nginx/apache issue. When using mono, try to use the xsp webserver that ships with mono to host your application without using nginx or apache, and check the results of the Cache-Control headers. If they are wrongly set to public, max-age=0 even without nginx/apache in between, this might be a bug in mono.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号