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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:49:22+00:00 2026-06-13T01:49:22+00:00

How to disable automatic browser caching from asp.Net mvc application? Because I am having

  • 0

How to disable automatic browser caching from asp.Net mvc application?

Because I am having a problem with caching as it caches all links. But sometimes it redirected to DEFAULT INDEX PAGE automatically
which stored it caching and then all the time I click to that link it will redirect me to DEFAULT INDEX PAGE.

So some one know how to manually disable caching option from ASP.NET MVC 4?

  • 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-06-13T01:49:24+00:00Added an answer on June 13, 2026 at 1:49 am

    You can use the OutputCacheAttribute to control server and/or browser caching for specific actions or all actions in a controller.

    Disable for all actions in a controller

    [OutputCacheAttribute(VaryByParam = "*", Duration = 0, NoStore = true)] // will be applied to all actions in MyController, unless those actions override with their own decoration
    public class MyController : Controller
    {
      // ... 
    }
    

    Disable for a specific action:

    public class MyController : Controller
    {
        [OutputCacheAttribute(VaryByParam = "*", Duration = 0, NoStore = true)] // will disable caching for Index only
        public ActionResult Index()
        {
           return View();
        }
    } 
    

    If you want to apply a default caching strategy to all actions in all controllers, you can add a global action filter by editing your global.asax.cs and looking for the RegisterGlobalFilters method. This method is added in the default MVC application project template.

    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new OutputCacheAttribute
                        {
                            VaryByParam = "*",
                            Duration = 0,
                            NoStore = true,
                        });
        // the rest of your global filters here
    }
    

    This will cause it to apply the OutputCacheAttribute specified above to every action, which will disable server and browser caching. You should still be able to override this no-cache by adding OutputCacheAttribute to specific actions and controllers.

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

Sidebar

Related Questions

I wanna disable the automatic slide in from right to left animation/transition. All new
In a JSF application, the parameter javax.faces.FACELETS_REFRESH_PERIOD can be used to enable/disable automatic reloading
I want to disable the automatic brightness (I want to prevent the screen from
i need to disable automatic url encoding in flash as2 because i have URL
While developing an ASP.NET site, is the a way to setup automatic login? For
Is there a way to disable android application automatic restart after a crash (Android
How do I disable automatic correction when a user is typing in my application
Is it possible to disable the OData support? I dont want this automatism because
How do you disable automatic double-slases removing? When I put base64 embeded image (<
I'm trying to disable the automatic closing of brackets in Eclipse, and while I've

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.