Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 752965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:50:33+00:00 2026-05-14T14:50:33+00:00

I’ve got a handler (list.ashx for example) that has a method that retrieves a

  • 0

I’ve got a handler (list.ashx for example) that has a method that retrieves a large dataset, then grabs only the records that will be shown on any given “page” of data. We are allowing the users to do sorting on these results. So, on any given page run, I will be retrieving a dataset that I just got a few seconds/minutes ago, but reordering them, or showing the next page of data, etc.

My point is that my dataset really hasn’t changed. Normally, the dataset would be stuck into the viewstate of a page, but since I’m using a handler, I don’t have that convenience. At least I don’t think so.

So, what is a common way to store the viewstate associated with a current user’s given page when using a handler? Is there a way to take the dataset, encode it somehow and send that back to the user, and then on the next call, pass it back and then rehydrate a dataset from those bits?

I don’t think Session would be a good place to store it since we might have 1000 users all viewing different datasets of different data, and that could bring the server to its knees. At least I think so.

Does anyone have any experience with this kind of situation, and can you give me any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:50:34+00:00Added an answer on May 14, 2026 at 2:50 pm

    In this situation I would use a cache with some type of user and query info as the key. The reason being is you say it is a large dataset. Right there is something you don’t want to be pushing up and down the pipe constantly. Remember your server still has to received the data if it is in ViewState and handle it. I would do something like this which would cache it for a specific user and have a short expiry:

    public DataSet GetSomeData(string user, string query, string sort)
    {
        // You could make the key just based on the query params but figured
        // you would want the user in there as well.
        // You could user just the user if you want to limit it to one cached item
        // per user too.
        string key = string.Format("{0}:{1}", user, query);
    
        DataSet ds = HttpContext.Current.Cache[key] as DataSet;
        if (ds == null)
        {
            // Need to reload or get the data
            ds = LoadMyData(query);
    
            // Now store it and make the expiry short so it doesn't bog up your server
            // needlessly... worst case you have to retrieve it again because the data
            // has expired.
            HttpContext.Current.Cache.Insert(key, ds, null,
                DateTime.UtcNow.AddMinutes(yourTimeout), 
                System.Web.Caching.Cache.NoSlidingExpiration);
        }
    
        // Perform the sort or leave as default sorting and return
        return (string.IsNullOrEmpty(sort) ? ds : sortSortMyDataSet(ds, sort));
    }
    

    When you say 1000’s of users, does that mean concurrent users? If your expiration time was 1 minute how many concurrent users would make that call in a minute and require sorting. I think offloading the data to something like similar to ViewState is just trading some cache memory for bandwidth and processing load of larget requests back and forth. The less you have to transmit back and forth the better in my opinion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 379k
  • Answers 379k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is just a thought. I've never tried it myself...… May 14, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer Using "include guards" (Wikipedia link) #ifndef MYHEADER_H #define MYHEADER_H //… May 14, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer Your assignment operator requires a reference, not a const reference:… May 14, 2026 at 9:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.