![]() |
Is Caching disabled by default ???
I have a usercontrol showing some generic information across multiple
screens. As per MS, caching is disabled by default so i didn't put a @OutputCache directive in my control. I found the control being cached at several occassions so was forced to put some code to disable caching explicitely. Here are the lines of code i put to stop the control from being cached: Response.Cache.SetCacheability(HttpCacheability.No Cache) Response.Expires = -1 Response.Cache.SetNoStore() But even now i see instances where the data on the control seems to be caching and users see each other's data on this control. Can anyone please help me find if i am doing something wrong here. |
Re: Is Caching disabled by default ???
Girish wrote:
> I have a usercontrol showing some generic information across multiple > screens. As per MS, caching is disabled by default so i didn't put a > @OutputCache directive in my control. I found the control being > cached at several occassions so was forced to put some code to > disable caching explicitely. Here are the lines of code i put to stop > the control from being cached: > > Response.Cache.SetCacheability(HttpCacheability.No Cache) > Response.Expires = -1 > Response.Cache.SetNoStore() > > But even now i see instances where the data on the control seems to > be caching and users see each other's data on this control. Can > anyone please help me find if i am doing something wrong here. You're confusing fragment caching with HTTP caching. Your code controls HTTP caching, thus affecting the whole page. Because your page was cacheable before you added these lines, it must have seemed as though the controls were cached -- but it was most likely the entire page. Cheers, -- http://www.joergjooss.de mailto:news-reply@joergjooss.de |
| All times are GMT. The time now is 08:30 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.