By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,087 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,087 IT Pros & Developers. It's quick & easy.

Can I use Data Caching without a Session?

P: n/a
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...

Aug 19 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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
Aug 19 '08 #2

P: n/a
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.Cache doc for details but for now I'm not sure it
would solve your issue...

--
Patrice
"John Kotuby" <jo***@powerlist.coma écrit dans le message de groupe de
discussion : eb**************@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...

Aug 19 '08 #3

P: n/a
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" <ne*********@spamgourmet.comwrote in message
news:uI**************@TK2MSFTNGP04.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


Aug 19 '08 #4

P: n/a
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:88**********************************@microsof t.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.Cache doc for details but for now I'm not sure it
would solve your issue...

--
Patrice
"John Kotuby" <jo***@powerlist.coma écrit dans le message de groupe de
discussion : eb**************@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...


Aug 19 '08 #5

P: n/a
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.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition",
"attachment;filename=summary.xls"); // "save as" filename

// TODO: calculate the xls result

Response.Write(resultString);
// or Response.BinaryWrite(resultByteArray);
Response.End();

Hans Kesting
Aug 20 '08 #6

P: n/a
Thanks for the tip Hans. I have tried it and it works.

"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uc**************@TK2MSFTNGP06.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.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition",
"attachment;filename=summary.xls"); // "save as" filename

// TODO: calculate the xls result

Response.Write(resultString);
// or Response.BinaryWrite(resultByteArray);
Response.End();

Hans Kesting

Aug 21 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.