how to set up both httpexpires and cachecontrol headers

后端 未结 2 2125
孤城傲影
孤城傲影 2020-12-07 04:47

I want to set up both expires and cachecontrol and httpExpires headers in web.config by following the answer on that question What'

相关标签:
2条回答
  • 2020-12-07 05:00
    <staticContent>
            <clientCache cacheControlCustom="public;max-age" cacheControlMode="UseMaxAge" cacheControlMaxAge="10.00:00:00" />
    </staticContent>
    <urlCompression dynamicCompressionBeforeCache="true" />
    

    This worked fine for me to cache a request for 10 days.

    0 讨论(0)
  • 2020-12-07 05:15

    This IIS Client Cache page states that 'While the "Expires" and "max-age" settings are somewhat analagous, the "max-age" directive takes priority over "Expires"'. However, IIS generates HTTP 500 errors when one "max-age" clientCache entry was used in parallel with an "Expires" clientCache entry.

    The "Expires" and "max-age" are mutually exclusive of one another when adjusting the "Set Common Headers" in IIS. You can use one or the other, but not both.

    Other cache directives can be applied to subfolders or specific files in Web.config. See this stackoverflow page on configuring cache content in IIS7.

    0 讨论(0)
提交回复
热议问题