1

I have different urls that points to the same code

www.url1.com www.url2.com

I need to use the cache, but if the asp net cache is enabled when someone access to www.url1.com next person accessing www.url2.com could get the previously cached data (www.url1.com)

I need to have ALL caches activated except this one.

5
  • Your question isn't really clear. There is only one cache per HttpApplication. What do you mean "all caches"? Commented Mar 25, 2010 at 21:33
  • Browser cache, proxy cache, asp net cache, iis cache, etc, etc, etc. Any other cache except the asp net output cache understand that www.url1.com is different to www.url2.com Commented Mar 25, 2010 at 21:34
  • So when you say "I need to use the cache", what are you talking about? These are all very different things. Commented Mar 25, 2010 at 21:36
  • www.url1.com and www.url2.com have completely different content. but asp output cache is in the middle so when someone access to www.url1.com this is cached on the server and the next person accessing www.url2.com received the previously cached content of www.url1.com. I need to use private cache, proxy cache, but not this server cache that is bother me. Commented Mar 25, 2010 at 21:41
  • Just don't put anything in the output cache then. Unless you actually tell it to cache something, it won't be caching anything. Commented Mar 25, 2010 at 21:44

1 Answer 1

2

You can disable ASP.Net output caching for the entire application by putting it in your web.config file.

<configuration>
    <system.web>
        <caching>
            <outputCache enableOutputCache="false">
            </outputCache>
        </caching>
    </system.web>
</configuration>

But unless you're actually putting anything in the cache in the first place, you don't have anything to worry about.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks womp but that would completely disable the cache for my app. I think I have it: I added response.Cache.SetNoServerCaching(); +1 anyway for giving me a hand. Thanks a lot!
Haha - I'm still confused, but no problem :)
actually, I was confused. I thought that with your configuration I would lost the cache support on ALL the way from client to server. But it only affects (as the name says) the asp output cache. If I add other cache headers this doesn't override them. Sorry for the confusion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.