ASP.NET Caching

B

BillGatesFan

I'm trying to understand ASP.NET caching. I set the Page Output
directive to VaryByParams= None and the duration = 60.


Now whenever users hit my web app they can see each others data. Is
there anyway to cache the page without this happening or am I using
Page Output caching in the wrong situation?

It's a data entry web app that I'm trying to increase the performance
on.
 
G

Guest

Using output caching caches the HTML for the page on the server and uses that
HTML for subsequent requests, rather than regenerating the code for each one.
This is why your users are seeing each other's data.

There are several other options and without more info about your app I can't
tell you which will work for you.

VaryByParam: If you are using paramters in the URL then you can use the
VaryByParam property with output cahching to store different versions of the
HTML based on the values of the parameter in the URL.

Partial Caching: If you want to cache only parts of the page and keep others
dynamic look into partial page or fragment caching.

Data Caching: This may be what you are looking for. You can cache the data
(DataSets, DataTables, etc) that you are using in your application. For
instance, you can cache a dataset then create a view for each user based on
thier selections.

There is a lot information about these options if you do some searching.

Hope this helps
 
G

Guest

Hi Mr.BillGatesFan,

Storing the data in cache is always better from the view of performance.
Since you are storing the values in the cache, which is globally visible and
common for the entire application, all your usersare able to see the data..

What you can do is, use the VaryByControl and assign the session ID of the
user to a control, say a textbox, use VaryByControl and vary by the textbox
control...

So, two sessions will not overlap..

HTH,

Need any help, do post a msg back

Happy Coding
 
B

BillGatesFan

My app is a mult-user app that consist of a web forms with 3 panels and
about 10 textboxes on each panel for the user to fill in. When they
iterate through the 3 panels and click the save button, the data is
saved to the database. And that is basically my app.

Is there any caching I can do to increase performance?

Thanks
 
G

Guest

What data is overlapping if all the user is doing is filling in textboxes.
Are you pulling data from a database for display anywhere? Do you have a
static header/footer/menu that could be cached?

Depending on the user load you should be careful when using the session id
to cache a seperate copy of the page for each user. If you have a high user
load you can see how using output caching to cache an individual copy of the
page for each user could cause problems.
 
H

Hans Kesting

BillGatesFan said:
I'm trying to understand ASP.NET caching. I set the Page Output
directive to VaryByParams= None and the duration = 60.


Now whenever users hit my web app they can see each others data. Is
there anyway to cache the page without this happening or am I using
Page Output caching in the wrong situation?

It's a data entry web app that I'm trying to increase the performance
on.

Caching is used in situations where the same html should be generated
by a possibly slow process. The html output is cached so that is doesn't
need to be regenerated.So this works best on "static" pages (or parts)
I don't think a data-entry form is a good choice for caching.

Where is the bottleneck in this case? Getting the form to the browser
or processing the completed form? In the second case you can't benefit
from caching.
 
B

Bill Gates Brother

Thanks. That cleared up alot of issues. Forums are a great place to
learn.
 
2

2kool

Hans is certainly refering to page output caching, which caches html
generated by server-side code.

In the scenario you explained, I do not see any major need for caching.
However, just to make you aware for future use, you can also use the
Cache object on the server side to cache data.
 
B

Bill Gates Brother

I know what is really slowing performance down is these 3rd party
controls I'm using. The viewstate for them is huge! Also since I cannot
control the browser my users are using, I have to do all the validation
on the server.

One question I want to ask all of you. How compatible is Javascript with
all the browsers. Is there any version that is completely safe to use
with all browsers? Thanks
 
K

Kevin Spencer

One question I want to ask all of you. How compatible is Javascript with
all the browsers. Is there any version that is completely safe to use
with all browsers? Thanks

I don't know of any browsers that don't support JavaScript. ASP.Net uses it
extensively.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Leverage browser caching 2
Caching .. 4
Browser page caching 0
Directory Caching, suggestions and comments? 0
Asp.net Important Topics. 0
asp.net caching expiration problem 0
Fragment Caching 0
ASP.Net Caching 12

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top