Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 利用浏览器缓存功能';t缓存Javascript和CSS文件_C#_Asp.net_Caching_Iis 7_Web Config - Fatal编程技术网

C# 利用浏览器缓存功能';t缓存Javascript和CSS文件

C# 利用浏览器缓存功能';t缓存Javascript和CSS文件,c#,asp.net,caching,iis-7,web-config,C#,Asp.net,Caching,Iis 7,Web Config,我有一个网站运行在IIS7,C#.Net 4上,我使用web.config文件将浏览器缓存设置为14天: <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="14.00:00:00" /> 它同时经过14天和1天,1天设置是最重要的值 有人知道这是为什么或如何发生的吗?请尝试按照system.webServer标记下的代码更新您的web配置 <cac

我有一个网站运行在IIS7,C#.Net 4上,我使用web.config文件将浏览器缓存设置为14天:

<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="14.00:00:00" />
它同时经过14天和1天,1天设置是最重要的值


有人知道这是为什么或如何发生的吗?

请尝试按照system.webServer标记下的代码更新您的web配置

<caching>
                <profiles>

                    <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="DontCache" />
                    <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="DontCache" />

                </profiles>
            </caching>
            <staticContent>
                <clientCache cacheControlCustom="public" 
            cacheControlMode="UseMaxAge"
            cacheControlMaxAge="14.00:00:00" />
            </staticContent>

您检查过了吗?
<caching>
                <profiles>

                    <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="DontCache" />
                    <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="DontCache" />

                </profiles>
            </caching>
            <staticContent>
                <clientCache cacheControlCustom="public" 
            cacheControlMode="UseMaxAge"
            cacheControlMaxAge="14.00:00:00" />
            </staticContent>