Questions tagged [outputcache]

OutPut Cache is the caching technique to cache the static pages in ASP.NET.

680 questions
3
votes
1 answer

ASP.NET MVC OutputCacheAttribute: do not cache if a parameter is set?

I have the following action: public class HomeController : Controller { public ActionResult Index(int? id) { /* ... */ } } I'd like to [OutputCache] that action, but I'd like that either: it doesn't use the cache if id == null; or it uses the…
Bruno Reis
  • 37,201
  • 11
  • 119
  • 156
3
votes
1 answer

OutputCache Stopped Working

I'm not sure what caused this, but our controller action use to cache its output but it no longer does: [HttpGet] [OutputCache(VaryByParam = "slug", Duration = 3600)] public ContentResult Index(string slug) { // each call to the page returns a…
Swisher Sweet
  • 769
  • 11
  • 33
3
votes
1 answer

MVC WebImage OutputCache results in content type of text/html

I'm trying to add an OutputCache to an MVC Action that has a WebImage.Write() response but as soon as I add it (even with a duration of 0) the content type changes from image/jpeg to text/html and I get the image rendered out as text in the…
Rob
  • 10,004
  • 5
  • 61
  • 91
3
votes
1 answer

ASP.NET - Server control output cache

Is it possible to change the output cache and it's duration for specific control, from code-behind? I mean, let's say I have control News.ascx that has: <%@ OutputCache Duration="60" VaryByCustom="language" %> Now I want to write somewhere some…
Alex Dn
  • 5,465
  • 7
  • 41
  • 79
3
votes
1 answer

ASP.NET MVC4 - OutputCache exception

I'm able to appropriately utilize the ASP.NET MVC4 OutputCache with the following code as an attribute on my Controller's Index(): [OutputCache(Duration = 600, VaryByParam = "none")] However, To manage differing caching scenario's, per the MSDN…
id.ot
  • 3,071
  • 1
  • 32
  • 47
3
votes
1 answer

ASP.net MVC OutputCache parameter priority - Duration vs SQLDependency

I'm building a ASP.net MVC 4 system that is very load intensive and want to use the OutputCache attribute on the two key pages. The OutputCache has the desired effect in making the pages very quick but I need to be able to control when they expire,…
Tom Styles
  • 1,098
  • 9
  • 20
3
votes
2 answers

asp.net mvc after logout when login from other user previous users detail is showing

I have a web application, when the first user logs in and open his profile and logout. when second user login on same computer after logout first user, and open profile, it showing first user profile. second user has to refresh page. how to…
shailendra
  • 205
  • 1
  • 8
  • 21
3
votes
1 answer

how to remove OutputCache programmatically for ascx?

I have a page1.aspx: <%@ Register src="uc1.ascx" tagname="UcHead" tagprefix="uc1" %> and uc1.ascx using the OutputCache: <%@ OutputCache Duration="18000" VaryByParam="*" %> How can I click a button in another page2.aspx to remove OutputCache for…
Mike108
  • 2,089
  • 7
  • 34
  • 45
3
votes
2 answers

ASP.NET and the Output Cache - how can see if it's working?

Problem: I've got an ASP.NET website and i don't believe that my code is getting OutputCached correctly. I'm using IIS7 performance counters to show me the hits or misses a second. i've got a simple ASP.NET MVC website. I'm using the built in…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
3
votes
1 answer

Is there a method to cache Razor page in Service Stack?

I'm new to Service Stack, just discovered and looks very interesting to use. I'd like my future websites to be quite backbone heavy but still ensure they can mostly be indexed by Google and seen by people with JavaScript (more for Google indexing)…
Flo
  • 33
  • 1
  • 4
3
votes
2 answers

Output cache is not working .net4.0

We are working on a asp.net site with .net framework 4.0. and we tried to incorporate output cache for it. But unfortunately it is not worked. Later we found removing Microsoft security update KB2656351 will solve the problem. I want to know…
Chamika Sandamal
  • 23,565
  • 5
  • 63
  • 86
3
votes
0 answers

How can I log the reason why and when item is removed from OutputCache

I have an action that uses outputcaching On the view that is rendered by the action I display the current time to check if the output comes from the cache: I realized that the page is not cached…
Mathias F
  • 15,906
  • 22
  • 89
  • 159
3
votes
2 answers

Using Output Cache in MVC for Object Parameter

This is my controller method. Can anyone explain how I could write outputcache for the following method on the server. public JsonResult GetCenterByStateCityName(string name, string state, string city, bool sportOnly, bool rvpOnly) { …
Krishh
  • 4,111
  • 5
  • 42
  • 52
3
votes
1 answer

ASP.NET outputCache, varyByParam, varyByHeader and AJAX

I'm using an outputcache for all my Umbraco v4 pages but would like to avoid such cache for any Ajax call ... I added this line in default.aspx: <%@OutputCache CacheProfile="umbProfil" %> Then, in web.config:
user1288337
  • 135
  • 1
  • 2
  • 7
3
votes
2 answers

Clearing outputcache on client side

As the title says, how can i clear Outputcache on client side? I have several ajax calls that needs to be cleared after user does some specific actions. I tried: Response.RemoveOutputCacheItem(Url.Action("Action", "Controller")); But it didn't…
AdrianoRR
  • 1,131
  • 1
  • 17
  • 36