Caching IIS映像缓存指令导致500.19错误

Caching IIS映像缓存指令导致500.19错误,caching,iis,iis-7.5,browser-cache,Caching,Iis,Iis 7.5,Browser Cache,我想将缓存头添加到IIS上的浏览器中。我发现: 但这也会导致500.19错误,它表示:“无法读取配置节‘staticContent’,因为它缺少节声明” 我的web.config文件如下所示: <?xml version="1.0"?> <configuration> <appSettings/> <connectionStrings/> <system.web> <compilati

我想将缓存头添加到IIS上的浏览器中。我发现:


但这也会导致500.19错误,它表示:“无法读取配置节‘staticContent’,因为它缺少节声明”

我的web.config文件如下所示:

<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
        <compilation debug="false"></compilation>
        <authentication mode="Windows"/>
    </system.web>
    <system.webServer>
        <httpErrors errorMode="Custom">
            <remove statusCode="404" subStatusCode="-1"/>
            <error statusCode="404" prefixLanguageFilePath="" path="/rewrite.asp" responseMode="ExecuteURL"/>
        </httpErrors>
    </system.webServer>
</configuration>


如何防止此错误?

可能最适合在或上询问
<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
        <compilation debug="false"></compilation>
        <authentication mode="Windows"/>
    </system.web>
    <system.webServer>
        <httpErrors errorMode="Custom">
            <remove statusCode="404" subStatusCode="-1"/>
            <error statusCode="404" prefixLanguageFilePath="" path="/rewrite.asp" responseMode="ExecuteURL"/>
        </httpErrors>
    </system.webServer>
</configuration>