Newbie: Page level caching in ASP.NET

Discussion in 'ASP .Net' started by Navin Mishra, Dec 14, 2005.

  1. Navin Mishra

    Navin Mishra Guest

    Hi,

    How could Page level caching be implemented in ASP.NET ? My ASP.NET page
    takes some query arguments and I want page level cache to last for the
    lifetime of the page generated using the passed arguments only. If different
    arguments are passed, I want new page level cache for the new page. Is it as
    simple as adding page level variables ? Note page may query data
    asynchronously using AJAX also. Does it change things ?

    Thanks and regards

    Navin
    Navin Mishra, Dec 14, 2005
    #1
    1. Advertising

  2. Navin Mishra

    Karl Seguin Guest

    Ajax shouldn't screw around with anything.

    To cache different versions based on querystring values, use the VaryByParam
    attribute of the OutputCache control

    <%@ OutputCache Duration="3600" VaryByParam="id" %>

    assuming "id" is the querystring you want to create a different cache on.

    Take a look at:
    http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx

    Karl

    --

    MY ASP.Net tutorials
    http://www.openmymind.net/



    "Navin Mishra" <> wrote in message
    news:...
    > Hi,
    >
    > How could Page level caching be implemented in ASP.NET ? My ASP.NET page
    > takes some query arguments and I want page level cache to last for the
    > lifetime of the page generated using the passed arguments only. If
    > different
    > arguments are passed, I want new page level cache for the new page. Is it
    > as
    > simple as adding page level variables ? Note page may query data
    > asynchronously using AJAX also. Does it change things ?
    >
    > Thanks and regards
    >
    > Navin
    >
    >
    Karl Seguin, Dec 14, 2005
    #2
    1. Advertising

  3. Navin Mishra

    Navin Mishra Guest

    Thanks. My qyery string is long passing a bunch of arguments. Would it work
    for a combination of query string arguments ? Is there a limit ? I also
    wanted simple caching while generated page is active and, to use the cache,
    when an action is performed on the page. When page is destroyed, I want to
    clear THAT page level cache. Would simple page level variables do that are
    garbage collected when Page object is destroyed after ASP.NET page request
    completes ?

    Thanks again and regards

    "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
    wrote in message news:...
    > Ajax shouldn't screw around with anything.
    >
    > To cache different versions based on querystring values, use the

    VaryByParam
    > attribute of the OutputCache control
    >
    > <%@ OutputCache Duration="3600" VaryByParam="id" %>
    >
    > assuming "id" is the querystring you want to create a different cache on.
    >
    > Take a look at:
    > http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx
    >
    > Karl
    >
    > --
    >
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    >
    >
    >
    > "Navin Mishra" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > How could Page level caching be implemented in ASP.NET ? My ASP.NET

    page
    > > takes some query arguments and I want page level cache to last for the
    > > lifetime of the page generated using the passed arguments only. If
    > > different
    > > arguments are passed, I want new page level cache for the new page. Is

    it
    > > as
    > > simple as adding page level variables ? Note page may query data
    > > asynchronously using AJAX also. Does it change things ?
    > >
    > > Thanks and regards
    > >
    > > Navin
    > >
    > >

    >
    >
    Navin Mishra, Dec 14, 2005
    #3
  4. Navin Mishra

    Navin Mishra Guest

    Comments appreciated! Is it possible ?

    Thanks in advance and regards

    "Navin Mishra" <> wrote in message
    news:%...
    >
    > Thanks. My qyery string is long passing a bunch of arguments. Would it

    work
    > for a combination of query string arguments ? Is there a limit ? I also
    > wanted simple caching while generated page is active and, to use the

    cache,
    > when an action is performed on the page. When page is destroyed, I want to
    > clear THAT page level cache. Would simple page level variables do that are
    > garbage collected when Page object is destroyed after ASP.NET page request
    > completes ?
    >
    > Thanks again and regards
    >
    > "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
    > wrote in message news:...
    > > Ajax shouldn't screw around with anything.
    > >
    > > To cache different versions based on querystring values, use the

    > VaryByParam
    > > attribute of the OutputCache control
    > >
    > > <%@ OutputCache Duration="3600" VaryByParam="id" %>
    > >
    > > assuming "id" is the querystring you want to create a different cache

    on.
    > >
    > > Take a look at:
    > > http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx
    > >
    > > Karl
    > >
    > > --
    > >
    > > MY ASP.Net tutorials
    > > http://www.openmymind.net/
    > >
    > >
    > >
    > > "Navin Mishra" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > How could Page level caching be implemented in ASP.NET ? My ASP.NET

    > page
    > > > takes some query arguments and I want page level cache to last for the
    > > > lifetime of the page generated using the passed arguments only. If
    > > > different
    > > > arguments are passed, I want new page level cache for the new page. Is

    > it
    > > > as
    > > > simple as adding page level variables ? Note page may query data
    > > > asynchronously using AJAX also. Does it change things ?
    > > >
    > > > Thanks and regards
    > > >
    > > > Navin
    > > >
    > > >

    > >
    > >

    >
    >
    Navin Mishra, Dec 20, 2005
    #4
    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. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    768
    Troy Simpson
    Jan 19, 2004
  2. Replies:
    2
    Views:
    428
  3. pabbu
    Replies:
    8
    Views:
    707
    Marc Boyer
    Nov 7, 2005
  4. Bishop

    Page Level Caching?

    Bishop, Mar 13, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    348
    Cowboy \(Gregory A. Beamer\)
    Mar 13, 2008
  5. JimLad
    Replies:
    3
    Views:
    901
    JimLad
    Jan 21, 2010
Loading...

Share This Page