2011-06-27 14 views
0

私が設定しようとしている:firefoxで画像をキャッシュする方法は?

<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> 

Firefoxはまだ私のWeb.configファイルにも、上記と私の画像をキャッシュしないように思われます。私は次の提案を見つけました。これが助けになるかどうか誰にも分かりますか?誰でもこのようなものを使用していますか?

<location path="MyWebsite"> 
    <system.webServer> 
     <caching> 
      <profiles> 
       <add extension=".html" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
       <add extension=".htm" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
       <add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
       <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
       <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
       <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
       <add extension=".jpeg" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" /> 
      </profiles> 
     </caching> 
    </system.webServer> 
</location> 

答えて

1

IISで設定されているものがFireFoxで無視されました。 Cache-Control:

それはのCache-Controlヘッダのmax-年齢 例を追加しました最大エージング= X

私はcacheControlMode = "UseExpires" を使用するために私のweb.configファイルを変更しなければなりませんでした。

<system.webServer> 
    <staticContent> 
     <clientCache cacheControlCustom="public" cacheControlMode="UseExpires" httpExpires="Sun, 31 Dec 2034 00:00:00 GMT"/> 
    </staticContent> 
    </system.webServer> 

この設定では、Cache-ControlヘッダーとExpiresヘッダーが追加されました。 FireFoxにファイルをキャッシュするように指示したようだ。 例: キャッシュ制御:public 有効期限:2034年12月31日00:00:00 GMT

+0

また、firebugがキャッシュを無効にするように設定されている場合 –

関連する問題