Caching Question

M

Mark Whitton

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 datasets because of performance
issues and also they just aren't proper business entities.

When it comes to updating my database I generally use an identity value and
a datetime value to avoid multiple updates. e.g. Update Customers set .....
where Id = :Id and DateModified=:DateModified.

My problem is deciding where I should store this data within the webforms
layer. I don't want to store the whole business object as the majority of
the data is displayed on the webform, and only want to store the data
necessary to allow me to update on postback. I believe Session state is
not the answer, and application state is definitely not the answer, which
leaves me with View state or cookies. The problem with both of these is
security and also performance.

I'd appreciate your thoughts.
 
J

Jeffrey Palermo [MCP]

This is where performance testing comes into play. I use Microsoft's Web
Stress application. You should perform multiple tests in each scenario to
see which one is best for your production environment. If storing your
object in viewstate doubles the size of the page, then it probably isn't the
answer, and I'd use session. A cookie is limited to 4KB, so that's not the
answer either. As a rule, cookies should be used only for very small pieces
of data such as identifiers. I would probably use Session OR if it was THAT
big of a deal, get the data from the database on every request.

Best regards,
Jeffrey Palermo
 

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

Caching Unique Values For Update 2
Data caching question 3
Directory Caching, suggestions and comments? 0
Leverage browser caching 2
First time question 1
Caching data 6
Caching question 1
Caching .. 4

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top