私の web.config では、静的コンテンツのキャッシュを追加しようとしています:
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Sun, 1 Jan 2020 00:00:00 UTC" />
</staticContent>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
</system.webServer>
ただし、YSlow を実行すると! 「Add Expires Header」の評価はまだ F です。そのため、画像、CSS、Javascript ファイルなどの静的コンテンツがキャッシュされていないようです。
私が行ったweb.configの変更はServiceStackによって取得されないため、ServiceStackでこれを達成するにはどうすればよいですか。これは ASP.NET MVC で機能しますが、expires ヘッダーを含む静的コンテンツをサーバーにするにはどうすればよいですか?
これも試しましたが、静的ファイルはまだキャッシュされていません。
<system.webServer>
<staticContent>
<clientCache cacheControlMaxAge="30.00:00:00" cacheControlMode="UseMaxAge"/>
</staticContent>
</system.webServer>