473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Caching ViewState

Hi all.

I override Page's SavePageStateToPersistenceMedium(...) and
LoadPageStateFromPersistenceMedium() methods to keep page's ViewState on the
server. Very well documented approach, nothing fancy here. I use my own
custom session implementation for all users who log into the app. Each such
session has its encrypted unique string, blah blah... If I store ViewState
of each request on the server, I have to have a way to find correct
ViewState when user posts back. I didn't invented any weels when I decided
to use a combination of that unique sessionID and a path of requested file.
Together they make a perfect key that uniquely describes the "who" and
"where". Now. I decided to use Cache as a storage for ViewState. It was
working beautifully while I was developing this app on my localhost spending
average 0.003 sec to load and deserialize ViewState from Cache. I was
imitating dozens of concurrent users, etc. Was working. Then I delpoyed this
thing to the remote server (some hosting). On that server very often (every
5th or so request) I had an exception saying something like "corrupted
viewstate, do you use a farm?, blah blah". Hosting company swears they don't
use any farms, just RAID. Then I deployed this app on another remote server.
Same thing. Then I used hard drive to store ViewState there instead of Cache
and everything was back to normal again on all machines except that now it
was spending 0.04 secs to load ViewState. I red some stuff about MachineKey
but they talk about farms and gardens. The average size of one ViewState
encrypted text is 10 - 20 kb. Does size matter? :)

Why Cache scenario works fine on my local host and fails on remote
machines?? I can use Application for this, of course, because I can uniquely
identify a user, but I'd like to use "expiration" feature of Cache wich I'd
have to implement by myself in case of Application.

I would greatly appreciate any kind of help!!

Kikoz.
Nov 18 '05 #1
1 1410
when you use the cache, there is no guarantee that it will be kept. any
constraint on memory will cause the cache to be flushed. on your local box,
you are just running one web site, on the hosting server, there are more
than one, and the cache cannot grow as much.

you can use both, write the file and store in cache. if not in cache , read
from file. you could also store the viewstate in the session.

-- bruce (sqlwork.com)

"Kikoz" <ki***@hotmail.com> wrote in message
news:Oq*************@TK2MSFTNGP14.phx.gbl...
| Hi all.
|
| I override Page's SavePageStateToPersistenceMedium(...) and
| LoadPageStateFromPersistenceMedium() methods to keep page's ViewState on
the
| server. Very well documented approach, nothing fancy here. I use my own
| custom session implementation for all users who log into the app. Each
such
| session has its encrypted unique string, blah blah... If I store ViewState
| of each request on the server, I have to have a way to find correct
| ViewState when user posts back. I didn't invented any weels when I decided
| to use a combination of that unique sessionID and a path of requested
file.
| Together they make a perfect key that uniquely describes the "who" and
| "where". Now. I decided to use Cache as a storage for ViewState. It was
| working beautifully while I was developing this app on my localhost
spending
| average 0.003 sec to load and deserialize ViewState from Cache. I was
| imitating dozens of concurrent users, etc. Was working. Then I delpoyed
this
| thing to the remote server (some hosting). On that server very often
(every
| 5th or so request) I had an exception saying something like "corrupted
| viewstate, do you use a farm?, blah blah". Hosting company swears they
don't
| use any farms, just RAID. Then I deployed this app on another remote
server.
| Same thing. Then I used hard drive to store ViewState there instead of
Cache
| and everything was back to normal again on all machines except that now it
| was spending 0.04 secs to load ViewState. I red some stuff about
MachineKey
| but they talk about farms and gardens. The average size of one ViewState
| encrypted text is 10 - 20 kb. Does size matter? :)
|
| Why Cache scenario works fine on my local host and fails on remote
| machines?? I can use Application for this, of course, because I can
uniquely
| identify a user, but I'd like to use "expiration" feature of Cache wich
I'd
| have to implement by myself in case of Application.
|
| I would greatly appreciate any kind of help!!
|
| Kikoz.
|
|
Nov 18 '05 #2

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

Similar topics

15
by: olle | last post by:
Hi folks. I learning asp.net and compare it with traditional asp and Access-developing. The issue is this one: 1/I have this Ms Acceess adp-project application that works fine on my Ms Sql...
6
by: Hypo | last post by:
Im relatilvly new to a web programming in general, and here's the situation i have: I have a default page with dynamic content, and one button with onclick code something like this: { // do...
1
by: DJ Dev | last post by:
Basically, I have a web app which has a step-by-step flow. So the user fills a form, hits next and is taken to the next page, where the user enters more information in form. There are around 5...
2
by: Mark Whitton | last post by:
Hi, I am developing using ASP.Net using SQL Server and also have several layers in between, eventually producing a custom business object that is used to populate the web form. I don't use...
0
by: Chris | last post by:
I've been playing with the fragment caching and it seems to work fine. I have a user control that I set to cache. The user control has a few text boxes and a drop down list box populated from a...
8
by: clintonG | last post by:
I've got a big fat cow -- a wiazrd control with 19 steps -- and I need to put Bessie back in the barn. I need to learn how to cache the Viewstate for this page and maintain state should the user...
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
2
by: JJ | last post by:
If I were to use Caching for a dropdownlist can I disable viewstate for this control? Would I lose control behavior like selectedIndex etc.? I would think since my ddl has like 50+ rows in it and...
1
by: =?Utf-8?B?YWJjZA==?= | last post by:
My application is using ASP.NET 3.0 and My ASPX pages contain Master page, and content page. The content page (.aspx) has various User controls (ascx). My page view state is significantly large and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...

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.