我正在开发一个项目,我必须为IIS 7.5中托管的站点进行基于扩展的缓存。
我在web.config
:
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="00:10:00" />
</staticContent>
<caching enabled="true" enableKernelCache="true">
<profiles>
<add extension=".aspx" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".xml" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="10:00:00" location="Downstream" />
<add extension=".php" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".js" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".css" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".png" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="10:00:00" location="Downstream" />
<add extension=".axd" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".gif" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="10:00:00" location="Downstream" />
<add extension=".txt" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:05:00" location="Downstream" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".htm" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".vbs" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:10:00" location="Downstream" />
<add extension=".flv" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="10:00:00" location="Downstream" />
</profiles>
</caching>
但不知何故,在每次扩展时,我只获得10分钟的缓存TTL。
我还需要做些什么来完成这项工作吗?