Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: asdaveyPosted on 2006-04-16 at 18:23:20ID: 16466522
It depends.
The project that I'm working on at the moment can be connected to one of four different database technologies. Each have their pro's and con's but none have a consistent way to implement paging on the server side (ie the server only retrieves the rows needed for that page).
So we've had to implement our paging on the client side (by client side I mean the webserver as opposed to the database server). In a lot of respects this is dumb since we are forcing our web server to retrieve heaps of records into memory (which almost defeats the purpose of paging in the first place) and then determine which 20 records should be displayed. But we need the paging for of a UI reason (limited space).
Since it is likely that when the user see's a paged result set that they will navigate to at least one other page, we've implemented a client side cache. This saves us from making additional trips to the database to get the results of the other pages (since they were retrieved in the initial call).
The caveat of caching is its not the real data. If the data in the database changes, the user won't know about it for as long as they are using their cache. So we have a timeout on our cache. If its not hit within say 30 seconds, then another trip to the database is performed etc. The time to invalidate your cache depends heavily on the likelihood of data underneath changing and how important it is to display that data to the user.
Now to the second part of your question, how to implement the caching.
In ASP.Net 2 it is very easy, if you can use one of the datasource controls since they have caching built in. Which version of ASP.Net are you using?