开发者

caching images on browser

开发者 https://www.devze.com 2023-02-08 00:19 出处:网络
I开发者_如何学编程\'m running page performance tools in firebug and I keep getting the suggestion to cache images? I thought browsers cached images by default. How do you cache images?Here\'s how I ca

I开发者_如何学编程'm running page performance tools in firebug and I keep getting the suggestion to cache images? I thought browsers cached images by default. How do you cache images?


Here's how I cache in IIS7

<system.webServer>
    <staticContent>
        <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="90.00:00:00" />
        <remove fileExtension=".js" />
        <mimeMap fileExtension=".js" mimeType="text/javascript" />
    </staticContent>
    <caching>
        <profiles>
            <add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
            <add extension=".jpeg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
            <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
            <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
            <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
        </profiles>
    </caching>
</system.webServer>


it's just suggestion; browser will cache images by default,don't worry!

0

精彩评论

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