I'm looking for a way to configure caching only for anonymous users only. The reason I'm looking to do this is when users are logged in and they create content they don't immediately see the content. In our old system (linux/php/mysql) we had it configured to cache only the anonymous users and this wasn't an issue.
Right now we have caching setup in the web.config like this
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="High" duration="60" varyByParam="*" enabled="true"/>
<add name="Medium" duration="30" varyByParam="*" enabled="true"/>
<add name="Low" duration="10" varyByParam="*" enabled="true"/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
I know that I can add a varyByCustom="userName" like this post is talking about. But this doesn't solve my problem. It still caches the users login and the same problem exists.
As James says it's probably better to invalidate the cache in some way.
That way your are maintaining a cache for all your users anonymous or not. Why not also improve responsiveness for your administrators, they are after all going to be using the application the most perhaps?
Have you looked at SQL cache dependancy? That way when the table that stores the content is altered then the cache is invalidated for you.
http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With