Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Is Caching disabled by default ??? (http://www.velocityreviews.com/forums/t757382-is-caching-disabled-by-default.html)

Girish 01-10-2005 03:39 PM

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.

Joerg Jooss 01-16-2005 09:05 AM

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 06:07 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.