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 7696225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:43:49+00:00 2026-05-31T21:43:49+00:00

I am building MVC application and would like to put caching in my application.

  • 0

I am building MVC application and would like to put caching in my application. I have read about caching that you need to just put [OutputCache(Duration=60, VaryByParam="none")] above controller method and it will work. However in my case i would like to cache not for whole controller methods but inner methods which would call from index controller and which will return IEnumerable<SelectListItem> and that result i want to cache.

But caching is only work for controller methods which will result view result, i have also searched for caching for non view methods and found some MVCDonutCaching and read this articles and by installing tried this also as per below

   [DonutOutputCache(Duration=60, VaryByParam="none")]
    public IEnumerable<SelectListItem> GetRegionList()
    {
        Region region = new Region();

        return region.GetRegionsList();
    }

But not luck to achieve my goal! have anyone done this type of caching here? then please help me to achieve this things.

Thanks in Advance.

  • 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-31T21:43:50+00:00Added an answer on May 31, 2026 at 9:43 pm

    I believe your problem is not with mvc itself but with caching model data. Caching your controller action is like forming static page and saving it in IIS cache. Every time user asks for the “Home/Index” (for example), the IIS takes well-formed page (html) from cache without executing any code.

    What you’re trying to do is cache model data. That’s quite a different thing since it has nothing to do with IIS and html page forming. You could use existing solutions like:
    Unity Application Block – http://msdn.microsoft.com/en-us/library/ff649102.aspx
    Or this post from stackexchange: https://softwareengineering.stackexchange.com/questions/35709/recommendations-for-a-net-distributed-caching-framework

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

Sidebar

Related Questions

I'm building an Asp.net MVC 2 application. I have an entity called Team that
I'm building an MVC3 application and would like to have a form with a
I have some questions regarding MVC that I would like to clarify. At our
I'm building an ASP.NET MVC application with a form that needs validation. The majority
I am building an application in ASP.NET MVC 3 in which I have implemented
I am building a Windows form application using .NET 3.5. I would like to
I have an ASP.NET MVC application I'm building and I'm using a Master page.
I am building a multi-layered application that has an ASP.NET MVC web application. It
I'd like ask a question about building applications in .NET that use data from
I'm building an ASP.NET MVC application that uses a DDD (Domain Driven Design) approach

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.