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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:00:24+00:00 2026-06-16T02:00:24+00:00

Given a controller action that is decorated with an OutputCacheAttribute, is it possible for

  • 0

Given a controller action that is decorated with an OutputCacheAttribute, is it possible for the action itself to interact with the properties of the OutputCacheAttribute?

This would be useful if, for example, the action were to dynamically:

  • Determine the CacheItemPriority and have that be set before returning the ActionResult.
  • Determine that caching should be disabled for this particular request, and thus the NoStore property is set to true.

Yes, no? If the answer is no, then what would be my fallback for output-caching in MVC with this kind of action-based dynamic behavior?

  • 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-16T02:00:25+00:00Added an answer on June 16, 2026 at 2:00 am

    CacheItemPriority is not part of the OutputCacheAttribute so you’ll either need to subclass OutputCacheAttribute and modify from there or roll-your-own (likely by subclassing ActionFilterAttribute).

    The following article shows examples of what you are trying to do. It looks like it was written before the standard MVC OutputCacheAttribute had any parameters available on it, so the majority of the article is showing what you want or things very close to what you want.

    http://blog.maartenballiauw.be/post/2008/06/26/Creating-an-ASPNET-MVC-OutputCache-ActionFilterAttribute.aspx

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

Sidebar

Related Questions

In my controller i had given [ValidateInput(false)] for that particular Action in my return
Is there any way to specify that a given Controller or Action uses Session
How do I test a given controller action that uses cookies? How to set
I want to redirect my '/' uri to a given controller's action. I used
Given a particular URL, how do I find out for sure which controller action
How can I get the controller action (method) and controller type that will be
So, I'm doing like that at my controller action: json_document = JSON(params) (json gem)
Given a controller like this where it creates several instance variables for use by
This is the default route that is given when you create a project -
I have a controller action in ASP.NET MVC that handles uploaded files. However, it

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.