Enhancing ASP.NET Framework

  • Thread starter Dmitriy Zakharov
  • Start date
D

Dmitriy Zakharov

Hi Everyone,

You know how we have cache objects at different levels in ASP.NET.

For example, there is one at application level (Cache) and one at user level
(Session).

How about having one at page level ? I understand it can be done manually,
but why not embed it into the Framework ?

Any ideas ?

Dmitriy.
 
P

Patrice

You could use System.Web.HttpContext.Current.Items that is kept for the HTTP
request lifetime...

Patrice
 
P

Patrice

You may still want to explain your exact need. I don't really see what you
meant by "caching" at the page level.

IMO :
1 - for the request, you have items as previously posted
2 - for the page you can also cache the page content or fragments. Is this
what you meant ?
3 - caching objects themselves at the page level ? I don't really see what
you mean. You could use the Cache anyway using the page path.

I believe you are rather looking for 2 ?

Patrice

--
 
K

Kevin Spencer

Yeah, maybe they could put in some hidden form field where you could cache
data in the page. They could call it ViewState.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
G

Guest

Would really be cool isn't it? :)

Kevin Spencer said:
Yeah, maybe they could put in some hidden form field where you could cache
data in the page. They could call it ViewState.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
D

Dmitriy Zakharov

I'm not looking for output caching. I'm looking to persist some page-level
state on the server.

I have a page, which is an editor for a large dataset. I prefer to keep this
dataset in server's memory.

Any suggestions, except Cache and Session objects ?
 
D

Dmitriy Zakharov

ViewState is a hidden field on a form that stores anything as BASE64
encoded. The state information is bounced between client and server.

Its a good idea to store small non-critical objects in a ViewState.

Any ideas on bigger objects or sensitive information ?

Will you store temporary balance of someone's bank account in a client-side
ViewState ?
 
S

Scott Allen

Hi Dmitriy:

I think the chosen terminology caused some confusion. When you asked
for a technique to "cache page-level state", we assumed you meant
information that only needed to be around for the duration of the page
request. On the server side, the logical container for this would be
the HttpContext Item collection.

What I think you are looking for is really session state caching,
because it sounds like you need the information to outlive the
lifetime of a single page request and be available the next time the
client hits a page to get the editable DataSet object. In this case,
Session and Cache are the two built in mechanisms to keep state on the
server. The difference being that with cache, you'd have to scope the
entry to a specific user by keeping a user identifier in the cache
key.

HTH,
 
P

Patrice

You could also persists this to a file. Do you need such a large dataset for
edition or could the user select a smaller chunk before editing ?

What is the thing you don't like with Session or Cache ? Also the UI could
provide a point (such as "Save changes" button) at which changes are
committed in the DB allowing also to clear cached data (or to delete the
file used for caching).

IMO it would be quite hard to have this handled for you as - unlike caching
page content - the various steps will have each their own action to be
performed (loading from the database, editing while not done, deleting and
updating data once completed etc...)

Patrice

--
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top