In IIS7, I have the ability to set caching options. These options are added to my web.config as such ...
<caching maxCacheSize="262144"> <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>
However, I also have the following for "caching"
<staticContent> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="90.00:00:00" /> <remove fileExtension=".js" /> <mimeMap fileExtension=".js" mimeType="text/javascript" /> </staticContent>
What is the difference between these two configurations? They are both nested in the <system.webServer> , so they are both valid for IIS7.
Also, what is the correct approach when using them? Currently, I use only this folder with my static assets. I do not use this caching for anything else.
Thanks in advance.
Chase florell
source share