Is it possible to change the default output cache settings

I am trying to do something similar to this question , I have a multi-user application and you want to configure the output cache for each tenant. However, I would prefer not to use a custom one OutputCacheAttributeor have a profile OutputCacheand remember to use it everywhere.

Can I change the default profile settings OutputCacheby adding a host to the attribute VaryByHeader?

+3
source share
1 answer

Perhaps if you are using IIS7.X. I'm not sure if this will work for an MVC project.

, , system.webserver web.config:

<caching>
    <profiles>
        <add extension=".aspx" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="00:00:05" varyByHeaders="host" />
    </profiles>
</caching>

IIS, " " , , , web.config, - .

0

Source: https://habr.com/ru/post/1763816/


All Articles