Questions tagged [outputcache]

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

680 questions
3
votes
2 answers

ASP.NET MVC Caching vary by controller action parameter

Is there any way I can vary caching by a controller action parameter using the outputcache attribute? We have varybyparam which will not work if my parameters are embedded within the URL in a REST manner.
NabilS
  • 1,421
  • 1
  • 19
  • 31
3
votes
0 answers

How can I remove output cache for a specific action in a controller without input parameters of action

I have a question about caching in ASP.NET MVC 5. I have an action that decorates with OutputCacheAttribute. something like this: OutputCache(Duration = 900, Location = Server, VaryByParam = "id") somewhere in my application I want to manage caches…
Mojtaba Rezaie
  • 98
  • 1
  • 10
3
votes
2 answers

ASP.NET recreating cached control

I solved most of the issues I had with caching. But still there is one thing. I have a UserControl for which I use output caching. Just like this: <%@ OutputCache Duration="1200" VaryByParam="none" %> However, as you can see, the control is…
Adam
  • 756
  • 4
  • 10
  • 23
3
votes
1 answer

Does outputcaching varybyparams in webforms understand route parameters?

Does outputcaching VaryByParams in webforms understand route parameters? Such that if I have a route similar to "Content/{filename}/{more}" that I could do VaryByParams="filename" and have it return cached results based on filename and ignore any…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
3
votes
1 answer

Multiple tables in ountputcache attribute sqldependency mvc

I am using outputcache sqldependency and it works absolutely fine, but now I want to depend on multiple tables. [OutputCache(Duration = 600, SqlDependency = "db:table1")] My question: Is sqldependency support relying on multiple tables? if yes,…
Rana
  • 1,170
  • 3
  • 14
  • 28
3
votes
1 answer

IN Operator with SqlDependency is not working

Does sqldependency work with IN operator? My Command is: SELECT n.PublishedAt FROM dbo.Navigations n WHERE NavigationGroupId IN (SELECT ng.Id FROM dbo.NavigationGroups ng WHERE ng.SiteId = 1 …
Rana
  • 1,170
  • 3
  • 14
  • 28
3
votes
2 answers

Optimal ASP.Net cache duration for a large site?

I've read lots of material on how to do ASP.Net caching but little on the optimal duration that pages should be cached for. Let's say that I have a popular site with 50,000 pages. The content does not change frequently, so I could cache pages for…
David Veksler
  • 512
  • 1
  • 5
  • 14
3
votes
1 answer

How to use OutputCache in PartialView Controllers in MVC 5, C#?

I have Controller with PartialViewResult or JsonResult return type. I wanna cache it with [OutputCache], but it doesn't work at all and always the following Index controller Thread.Sleep(5000);…
Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232
3
votes
0 answers

outputCacheProfiles with Redis cache

I have an MVC web project and I am trying to setup OutputCache for some of the pages using redis cache running locally, eventually to be hosted in azure. I have decorated my ActionResult with [OutputCache(CacheProfile = "cacheprofile1")] and have…
robsta
  • 416
  • 5
  • 18
3
votes
1 answer

WebAPI OutputCache cache invalidation

I have the following caching attribute on my controller method: [CacheOutput(ClientTimeSpan = 14400, ServerTimeSpan = 14400)] I am attempting to clear the cache. However, after running this line of code: //clear cache …
Tom
  • 7,994
  • 8
  • 45
  • 62
3
votes
1 answer

Cache page without the navbar. User log-in/logout system doesn't update at all (MVC)

I'm trying to cache a page without the navbar of the page. When i cache the page its all works fine but I get unwanted behavior. Explanation: When I cache the index page for example, the navbar is also cached so if the user press the log-in button…
Ron
  • 1,744
  • 6
  • 27
  • 53
3
votes
2 answers

How to invalidate the OutputCache in a webfarm?

i've got a website that uses OutputCache attribute to cache pages. Works great. Now, I'm in the middle of R&D'ing scaling up this site to be in a web farm. Along with the usual suspects for webfarm pain ... I've noticed (pretty quickly/obviously)…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
3
votes
2 answers

Custom OutputCache provider generates different keys on Add() vs Set()

I'm writing a custom OutputCacheProvider in MVC3. The calls get fired in this order: Get, Add, Set. I expect that in all methods, the keys generated will be the same, but they're not. The problem is that in the different calls Get and Add are…
daviddeath
  • 2,483
  • 2
  • 17
  • 16
3
votes
1 answer

RemoveOutputCacheItem not working

I have an ActionResult that returns a file result: [OutputCache(VaryByParam = "document_id;size", Duration = 3 * 60 * 60, Location = OutputCacheLocation.Server)] public ActionResult GetDocumentThumbnail(Guid document_id, int size) { byte[]…
Catalin
  • 11,503
  • 19
  • 74
  • 147
3
votes
1 answer

application after being published stops updating the update panel after few minutes

This is the code which updates my updatepanel regularly, it runs very well on local for a long period of time but after being published, it works good for 15-20 minutes , may be lesser sometimes. but after that it does not update the contents inside…