2010-11-26 101 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中的一個錯誤。