Is Caching disabled by default ???

Discussion in 'ASP .Net Building Controls' started by Girish, Jan 10, 2005.

  1. Girish

    Girish Guest

    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.NoCache)
    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.
    Girish, Jan 10, 2005
    #1
    1. Advertising

  2. Girish

    Joerg Jooss Guest

    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.NoCache)
    > 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:
    Joerg Jooss, Jan 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hypo
    Replies:
    6
    Views:
    406
  2. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    784
    Troy Simpson
    Jan 19, 2004
  3. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    override default disabled font color

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Jul 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,093
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Jul 2, 2007
  4. JimLad
    Replies:
    3
    Views:
    911
    JimLad
    Jan 21, 2010
  5. J
    Replies:
    1
    Views:
    569
    Adrienne Boswell
    Apr 4, 2009
Loading...

Share This Page