473,505 Members | 16,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing an entire page's Contents in the Session

py
how feasible is it to cache an entire page's content in a session variable?
i am already doing it and it works fine, except i am afraid of scalability
issues. what is the best way to test this? and is there an obvious reason
why i should not do this.


Nov 19 '05 #1
7 1540
Why would you need to do that ?
The Cache object will do that more efficiently.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"py" <du***********@hotmail.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
how feasible is it to cache an entire page's content in a session
variable?
i am already doing it and it works fine, except i am afraid of scalability
issues. what is the best way to test this? and is there an obvious
reason
why i should not do this.

Nov 19 '05 #2
py
i am simply storing a root level webcontrol that contains all of my page
controls. i believe cache object will purge itself when it runs low. plus,
i dont need to share the page with other sessions - it is just for the
session that is displaying it - i.e. one page per end user, so session level
is the right scope.

it saves asp engine from having to re-instantiate all the controls on each
request and maintains the data state (which i have programmed to time out on
its own)


"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Why would you need to do that ?
The Cache object will do that more efficiently.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"py" <du***********@hotmail.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
how feasible is it to cache an entire page's content in a session
variable?
i am already doing it and it works fine, except i am afraid of
scalability
issues. what is the best way to test this? and is there an obvious
reason
why i should not do this.


Nov 19 '05 #3
Depends what you have there, however if you store something like controls
there, you're shooting yourself to leg for good. All those resources are
tied to the lifetime of a session, and it would be multiplicated per-user
basis.

I'd look into Caching as Juan hinted, depending on your case either data
caching with cache object or outout caching (caching the rendered content)
when you could avoid non-needed caching or cache only the necessary
resource-intensive part.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU

"py" <du***********@hotmail.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
how feasible is it to cache an entire page's content in a session
variable?
i am already doing it and it works fine, except i am afraid of scalability
issues. what is the best way to test this? and is there an obvious
reason
why i should not do this.

Nov 19 '05 #4
>it saves asp engine from having to re-instantiate all the controls on each
request and maintains the data state (which i have programmed to time out
on its own)
Believe me, Framework is optimized this in mind, classes including controls
are instantiated very fast, as they are compiled code etc. and instances odf
compiled page classes are cached after JIT'ing.

Another drawback with your approach is that Controls are not serializable.
This works as long as you have sessions in InProc (in-process) mode, however
if you need to switch to state server or SQL server for better reliability
(to stand app/process restarts), it won't work and you're on your own with
it.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
"py" <du***********@hotmail.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...i am simply storing a root level webcontrol that contains all of my page
controls. i believe cache object will purge itself when it runs low.
plus, i dont need to share the page with other sessions - it is just for
the session that is displaying it - i.e. one page per end user, so session
level is the right scope.

it saves asp engine from having to re-instantiate all the controls on each
request and maintains the data state (which i have programmed to time out
on its own)


"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Why would you need to do that ?
The Cache object will do that more efficiently.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"py" <du***********@hotmail.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
how feasible is it to cache an entire page's content in a session
variable?
i am already doing it and it works fine, except i am afraid of
scalability
issues. what is the best way to test this? and is there an obvious
reason
why i should not do this.



Nov 19 '05 #5
The Viewstate very often already does this in most cases. You should
probably elaborate on what exactly you are trying to do.

Nov 19 '05 #6
As a general rule, caching UI components is a bad idea. Cache is best used
for pure data.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"py" <du***********@hotmail.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
how feasible is it to cache an entire page's content in a session
variable?
i am already doing it and it works fine, except i am afraid of scalability
issues. what is the best way to test this? and is there an obvious
reason
why i should not do this.

Nov 19 '05 #7
py
ok - sounds like sound advice.

another related question:
how much data is reasonable to cache? i am using subclassed datatables as
my data source. when should i worry about memory consumption?

(i am embarassed to admit i dont know how to test for this)

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
As a general rule, caching UI components is a bad idea. Cache is best used
for pure data.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"py" <du***********@hotmail.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
how feasible is it to cache an entire page's content in a session
variable?
i am already doing it and it works fine, except i am afraid of
scalability
issues. what is the best way to test this? and is there an obvious
reason
why i should not do this.


Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1559
by: FlashMerlot | last post by:
We have an ASPX (C#) webform which hosts dropdownlists, textboxes, grids, checkboxes, etc. The users want to: #1 - "FREEZE" the entire webpage contents (and state) #2 - move IE browser to...
3
1435
by: yop | last post by:
Hello I have an application, Login page, enter UserName & Password. Function in Users called GetUserDetails and checks the details and if they are valid calls a function to fill the following...
6
2129
by: Jason | last post by:
Is it possible to store an entire datatable/dataset in session state? If so, could someone please provide a code snippet or a link to documentation for me please? (I'm having no luck at all) ...
6
1782
by: Al Wilkerson | last post by:
Hi, Does anyone know how to display the contents of a DataGrid on another aspx page. I have a aspx page that when the user clicks on a link button the database is queried and I want the results...
2
1731
by: Al Wilkerson | last post by:
Hey guys, I'm having problems with creating/storing a value in a session variable for later retrieving on another page. Here is the aspx page where I create/store the value ...
12
4951
by: Alex D. | last post by:
is it possible? pros and cons?
3
2029
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
6
17103
by: J055 | last post by:
Hi I have the following code. I upload an XML file using the FileUpload object, store the stream in a session so the user gets the chance to confirm some options then pass the stream from the...
2
1441
by: vivsonavane | last post by:
hi all i am making a web page which has a username to register but i dont want to put any password for completing registration. the idea is when user makes any decision and select ok one dialog...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.