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

  • SEARCH
  • Home
  • 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 6630477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:24:35+00:00 2026-05-25T22:24:35+00:00

I have a view in MVC3 application that calls a stored procedure (that takes

  • 0

I have a view in MVC3 application that calls a stored procedure (that takes a while to execute) to populate a grid on a view and would like to cache that data somehow? Not familiar with EF cacheing but I would actually like to somehow run the query possibly on a background thread in the background on start up so that when the user clicks on this particular view (which is a common data view the usere want to see) results are fast and cached as dispalyed in the webgrid

Any information would be greatly appreciated. Thanks!

  • 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-25T22:24:35+00:00Added an answer on May 25, 2026 at 10:24 pm

    Use the repository pattern to request your data entity. Inside your repository class cache the result in the MemoryCache (a specific type of cache in .net). Any time you then request the object the repository class knows to get it from te cache or not and the caller doesn’t need to know anything about the caching. I would use either code first OR the poco templates to not have any baggage stored from other dependencies .

    For POCO – you can either use the EF POCO Templates, or a code first model to give you poco classes without the EF baggage.
    Let me know if you have any specific q’s on these steps and I can go into more detail.
    If you need to take a while loading this on application start, another thread is definitely the way to do it as any long running Application_start code in the main thread can cause a deadlock. A more basic approach per user is to put the object in the users session but that’s indeed up to you.
    There is no EF caching as part if the EF framework that exists outside of the ObjectContext lifetime.
    Another method is to handle this in the controller method as shown here:
    How to cache mvc3 webgrid results (so that col sort click doesn't?

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

Sidebar

Related Questions

I have an MVC3 application with Razor and I created a View that inside
In my MVC3 application, I have a view model that I Json encode so
In an MVC3 application I have a view rendering two Ajax partial views: a
I have a View in my MVC 3 application that lets the user enter
I have an MVC3 application that I am implementing pjax into . Everything is
I have lots of forms in my MVC3 application that require the user to
In an ASP.NET MVC3 Application I have a button in the view. When the
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
We have a MVC3 application that we have created many small actions and views
I have a View in my MVC3 application which displays one of two pretty

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.