Results 1 to 4 of 4

Thread: How to handle the cache and datasets??

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    How to handle the cache and datasets??

    I have been given an asp.net app with about 20 webpages, all using datagrids and a method for binding a dataset to the grid. it also has a simple DAL. Now, one of my tasks is to improve performance. So I figured caching the datasets was a good way to start. But, for most of the pages, all postbacks are caused by the user changing the search parameters and a new dataset has to be fetched from the DAL. That means caching is relativly useless? What do you think? Should I pursue it?

    Also... one of the requirements, lets call it "nr 2" was that they want some pages to maintain viewstate between response.redirects... The users are tired of having to reselect search parameters when they press the "back button" (causing a hard coded response direct)

    ANy suggestions how to solve it? As far as I know, viewstate for server controls are not maintained when the context changes? Am I wrong?

    /Henrik

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: How to handle the cache and datasets??

    In relation to postbacks, you can use a simple piece of code:

    VB Code:
    1. Sub Page_Load( ... )
    2.     If Not IsPostBack Then
    3.        
    4.     End If
    5. End Sub

    So. Just do the SQL stuff once, store into the cache, and then that's that.


    In relation to storing user preferences, there are lots of ways of doing it. How are users selecting parameters, by tickboxes on forms or textboxes or what?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: How to handle the cache and datasets??

    Yeah I already knew about the postback, thanks I don't think its what I need to solve my performance problem.. I will dig further... Have just spent 2 hours reading through tons of msdn articles on the subject... sessionstate, viewstate, cache tips and tricks


    Anyway, second problem... About remembering viewstate between calls... the first solution that comes into mind is to store the control indexes in the cache along wiht control ID... but is it the best way?? So if it isn't a postback, check the cache for the selectedindexes and textbox texts...

    Or perhaps there is a way to dump the entire viewstate of an object to cache?? not just the properties... Perhaps a performance hit, but the quickest way to do it

    cya
    Henrik

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: How to handle the cache and datasets??

    Well, the search criteria could not be that big correct?

    I mean - you have a few true/falses, number ranges perhaps, or a few strings?

    You can save those parameters into viewstate - or if you're worried about context, have you looked into attaching that information in to a cookie?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width