Can I use Data Caching without a Session?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Kotuby

    #1

    Can I use Data Caching without a Session?

    Hi all,
    I am trying to get an ASPX page written in VB and VS 2008 to open more
    quickly inside of am Iframe in a standard HTML page.

    One of the things the page does is to allow users to click a link that
    generates an Excel file depending on the choices the suer has made on the
    ASPX page. The Link doesn't actually Post the page, so I can't use the Form
    fields to transmit data to the XLS creator.

    So I was using Session variables. However, I think that creating a Session
    causes too much overhead. Thus my question, can I use Data Caching without a
    Session? When the XLS generator is called via Hyperlink, how will it know
    which Cached variables it needs?

    Thanks...

  • Hans Kesting

    #2
    Re: Can I use Data Caching without a Session?

    John Kotuby pretended :
    Hi all,
    I am trying to get an ASPX page written in VB and VS 2008 to open more
    quickly inside of am Iframe in a standard HTML page.
    >
    One of the things the page does is to allow users to click a link that
    generates an Excel file depending on the choices the suer has made on the
    ASPX page. The Link doesn't actually Post the page, so I can't use the Form
    fields to transmit data to the XLS creator.
    >
    So I was using Session variables. However, I think that creating a Session
    causes too much overhead. Thus my question, can I use Data Caching without a
    Session? When the XLS generator is called via Hyperlink, how will it know
    which Cached variables it needs?
    >
    Thanks...
    Is that a single page where you can change some settings and click the
    XLS-link?
    If so, why not use a LinkButton? This looks just like a regular link to
    the user but posts the page so you can read the settings.

    If that settings-page is a different page, you could use cookies to
    store the settings. When the user clicks that (regular) link, the
    browser sends those cookies along with the request.
    If the settings are too large to store in cookies, maybe you could
    store them in the Cache on the server (or in a database) under some
    unique identifier. Store that ID (Guid??) in a cookie.

    Why do you think that creating a session is too much overhead?

    Hans Kesting


    Comment

    • Patrice

      #3
      Re: Can I use Data Caching without a Session?

      I'm not sure how these caching issues are related to the problem you have
      with displaying this page for the first time. Have you tried first to see
      where your time budget is spent ? Keep in mind it could be also not a server
      issue but rather the time needed to send back and render a huge html page to
      the browser...

      What is shown in this page ? Have you tried to time server side how long it
      takes ? it would give you a first clue...

      Each cache entry is stored under a name so you'll address the value by its
      name... See System.Web.Cach e doc for details but for now I'm not sure it
      would solve your issue...

      --
      Patrice


      "John Kotuby" <johnk@powerlis t.coma écrit dans le message de groupe de
      discussion : ebBijEfAJHA.328 4@TK2MSFTNGP03. phx.gbl...
      Hi all,
      I am trying to get an ASPX page written in VB and VS 2008 to open more
      quickly inside of am Iframe in a standard HTML page.
      >
      One of the things the page does is to allow users to click a link that
      generates an Excel file depending on the choices the suer has made on the
      ASPX page. The Link doesn't actually Post the page, so I can't use the
      Form fields to transmit data to the XLS creator.
      >
      So I was using Session variables. However, I think that creating a Session
      causes too much overhead. Thus my question, can I use Data Caching without
      a Session? When the XLS generator is called via Hyperlink, how will it
      know which Cached variables it needs?
      >
      Thanks...

      Comment

      • John Kotuby

        #4
        Re: Can I use Data Caching without a Session?

        Thanks Hans...
        It may be true that creating a session is not what is causing the overhead.
        The ASPX page in the Iframe itself is rather large 67K to 150K depending on
        the data and is multi-functioned. It contains a DataList control, a
        3rd-party Grid Control that allows client-side sorting and grouping,
        a Tabbed MultiView control that allows viewing of details of the Grid Item
        selected and a ListBox that the user can add items to.

        When the user clicks the XLS link, I want the page to remain in the
        background and the Excel file to be downloaded (or opened in Excel itself)
        rather than displayed in a new page. The idea is to keep the original page
        in the background while the user can perform multiple tasks. I can only get
        that to work properly (so far) using a standard hyperlink.

        What is being sent is not just a few settings but also a comma delimited
        list of IDs that are used to generate the details which occupy several
        worksheets including the Summary worksheet. I have had users submitting up
        to 500 IDs and creating HUGE spreadseets.

        The idea of sending a unique indentifier via cookie sounds like a good one.

        Thanks for responding...I will try to find other ways to accelerate the
        delivery of the original ASPX that resides in the Iframe.

        "Hans Kesting" <news.hansdk@sp amgourmet.comwr ote in message
        news:uIfWtQfAJH A.5900@TK2MSFTN GP04.phx.gbl...
        John Kotuby pretended :
        >Hi all,
        >I am trying to get an ASPX page written in VB and VS 2008 to open more
        >quickly inside of am Iframe in a standard HTML page.
        >>
        >One of the things the page does is to allow users to click a link that
        >generates an Excel file depending on the choices the suer has made on the
        >ASPX page. The Link doesn't actually Post the page, so I can't use the
        >Form fields to transmit data to the XLS creator.
        >>
        >So I was using Session variables. However, I think that creating a
        >Session causes too much overhead. Thus my question, can I use Data
        >Caching without a Session? When the XLS generator is called via
        >Hyperlink, how will it know which Cached variables it needs?
        >>
        >Thanks...
        >
        Is that a single page where you can change some settings and click the
        XLS-link?
        If so, why not use a LinkButton? This looks just like a regular link to
        the user but posts the page so you can read the settings.
        >
        If that settings-page is a different page, you could use cookies to store
        the settings. When the user clicks that (regular) link, the browser sends
        those cookies along with the request.
        If the settings are too large to store in cookies, maybe you could store
        them in the Cache on the server (or in a database) under some unique
        identifier. Store that ID (Guid??) in a cookie.
        >
        Why do you think that creating a session is too much overhead?
        >
        Hans Kesting
        >
        >

        Comment

        • John Kotuby

          #5
          Re: Can I use Data Caching without a Session?

          Thanks Patrice,

          I will try to see if I can cut the fat from the ASPX page if possible. Maybe
          the delay has nothing to do with creating a session. That is a very good
          point.

          I gave a more extensive answer about what is on the page to Hans who also
          responded.

          Thanks again.

          "Patrice" <http://www.chez.com/scribe/wrote in message
          news:8837704E-F2FA-4941-B201-9EB45D1B91E7@mi crosoft.com...
          I'm not sure how these caching issues are related to the problem you have
          with displaying this page for the first time. Have you tried first to see
          where your time budget is spent ? Keep in mind it could be also not a
          server issue but rather the time needed to send back and render a huge
          html page to the browser...
          >
          What is shown in this page ? Have you tried to time server side how long
          it takes ? it would give you a first clue...
          >
          Each cache entry is stored under a name so you'll address the value by its
          name... See System.Web.Cach e doc for details but for now I'm not sure it
          would solve your issue...
          >
          --
          Patrice
          >
          >
          "John Kotuby" <johnk@powerlis t.coma écrit dans le message de groupe de
          discussion : ebBijEfAJHA.328 4@TK2MSFTNGP03. phx.gbl...
          >Hi all,
          >I am trying to get an ASPX page written in VB and VS 2008 to open more
          >quickly inside of am Iframe in a standard HTML page.
          >>
          >One of the things the page does is to allow users to click a link that
          >generates an Excel file depending on the choices the suer has made on the
          >ASPX page. The Link doesn't actually Post the page, so I can't use the
          >Form fields to transmit data to the XLS creator.
          >>
          >So I was using Session variables. However, I think that creating a
          >Session causes too much overhead. Thus my question, can I use Data
          >Caching without a Session? When the XLS generator is called via
          >Hyperlink, how will it know which Cached variables it needs?
          >>
          >Thanks...
          >
          >

          Comment

          • Hans Kesting

            #6
            Re: Can I use Data Caching without a Session?

            on 19-8-2008, John Kotuby supposed :
            Thanks Hans...
            When the user clicks the XLS link, I want the page to remain in the
            background and the Excel file to be downloaded (or opened in Excel itself)
            rather than displayed in a new page. The idea is to keep the original page in
            the background while the user can perform multiple tasks. I can only get that
            to work properly (so far) using a standard hyperlink.
            >
            You can do that by setting an Http header value. In the Click handler
            do something like:

            Response.Clear( );
            Response.Conten tType = "applicatio n/vnd.ms-excel";
            Response.Append Header("Content-Disposition",
            "attachment;fil ename=summary.x ls"); // "save as" filename

            // TODO: calculate the xls result

            Response.Write( resultString);
            // or Response.Binary Write(resultByt eArray);
            Response.End();



            Hans Kesting


            Comment

            • John Kotuby

              #7
              Re: Can I use Data Caching without a Session?

              Thanks for the tip Hans. I have tried it and it works.

              "Hans Kesting" <news.hansdk@sp amgourmet.comwr ote in message
              news:uc0arCqAJH A.4992@TK2MSFTN GP06.phx.gbl...
              on 19-8-2008, John Kotuby supposed :
              >Thanks Hans...
              >
              >When the user clicks the XLS link, I want the page to remain in the
              >background and the Excel file to be downloaded (or opened in Excel
              >itself) rather than displayed in a new page. The idea is to keep the
              >original page in the background while the user can perform multiple
              >tasks. I can only get that to work properly (so far) using a standard
              >hyperlink.
              >>
              >
              You can do that by setting an Http header value. In the Click handler do
              something like:
              >
              Response.Clear( );
              Response.Conten tType = "applicatio n/vnd.ms-excel";
              Response.Append Header("Content-Disposition",
              "attachment;fil ename=summary.x ls"); // "save as" filename
              >
              // TODO: calculate the xls result
              >
              Response.Write( resultString);
              // or Response.Binary Write(resultByt eArray);
              Response.End();
              >
              >
              >
              Hans Kesting
              >
              >

              Comment

              Working...