Questions tagged [outputcache]

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

680 questions
11
votes
3 answers

ASP.NET MVC OutputCache doesn't work for root URI

I'm learning ASP.NET MVC and bugged by one issue. In the HomeController, the Index action has OutputCache attribute, but it seems doesn't work. [HandleError] public class HomeController : Controller { [OutputCache(Duration=5,…
Morgan Cheng
  • 73,950
  • 66
  • 171
  • 230
11
votes
1 answer

list OutputCache entry

in my asp.net mvc application i'm using the OutputCache attribute on different action method. Is possible to view the current entries on the cache related to OutputCache attribute? If i cicle on System.Web.HttpContext.Current.Cache i don't find this…
tartafe
  • 401
  • 5
  • 19
11
votes
3 answers

ASP.NET OutPutCache VaryByParam and VaryByHeader with AJAX

I'm trying to do some caching using VaryByParam AND VaryByHeader. When an AJAX request comes in I return a partial XHTML. When a regular request comes in I send the partial XHTML page with header / footer. I tried to cache the page by…
Denny Ferrassoli
  • 1,763
  • 3
  • 21
  • 40
11
votes
1 answer

How to cache output of action method that returns image to the view in asp.net mvc?

I've read lots of posts about caching already, but none of them actually match my needs exactly. In my mvc 3 app I have an action method GetImage() that returns a File of image type. Then I use this method in a view to display image:
Aleksei Chepovoi
  • 3,915
  • 8
  • 39
  • 77
10
votes
3 answers

What's the best method for forcing cache expiration in ASP.NET?

Suppose I have an ASP.NET application running across several web servers behind a load balancer: Can I: Force OutputCache (Page and/or Control level) to expire globally? Force Data Cache (i.e. Cache.Insert) to expire? Monitor ASP.NET caching usage…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
10
votes
4 answers

Bypass OutputCache in ASP.NET MVC

I am using the OutputCache attribute in my MVC website as follows: [OutputCache(Duration = 5000, VaryByParam = "name;region;model;id;op;content;featured;isStarred;page;size;")] However sometimes I'd like to bypass the output cache entirely…
Cranialsurge
  • 6,104
  • 7
  • 40
  • 39
10
votes
2 answers

OutputCache behavior in ASP.NET MVC 3

I was just testing Output Caching in the RC build of ASP.NET MVC 3. Somehow, it is not honoring the VaryByParam property (or rather, I am not sure I understand what is going on): public ActionResult View(UserViewCommand command) { Here,…
kidoman
  • 2,402
  • 5
  • 26
  • 35
10
votes
1 answer

.NET: Output caching for WebMethod?

Can I have the return value of a WebMethod outputcached? E.g. if the WebMethod has been called in the last X seconds or minutes, don't actually run the method again--just use the same result as it last served. Or should I roll my own caching…
Chris
10
votes
3 answers

ASP.NET MVC 3 Custom RouteBase and OutputCache

I have a problem with my custom RouteBase implementation and [OutputCache]. We have a CMS in which urls are mapped to certain content pages. Each type of content page is handled by a different controller (and different views). The urls are…
Jaap
  • 3,081
  • 2
  • 29
  • 50
9
votes
6 answers

ASP.NET OutputCache and Cookies

Does anyone know why if is have cookies on my page, the output cache does not work ! Example page <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ct.aspx.vb" Inherits="ct" %> <%@ OutputCache Duration="600" Location="Server"…
Symeon Breen
  • 1,531
  • 11
  • 25
9
votes
3 answers

OutputCache VaryByContentEncodings gzip doesn't work

I've set the OutputCache to include 'VaryByContentEncodings="gzip"' in my ASP.net ASPX page. I want the page to serve different css files, a gzipped if the browser support it and the regular non compressed if the browser doesn't support…
Liron Harel
  • 10,819
  • 26
  • 118
  • 217
9
votes
1 answer

OutputCache VaryByCustom cookie value

Is there a way to set the value of an OutputCache based on a cookie value? For simplicities sake, this is my method [OutputCache(Duration = 600, VaryByParam = "None", VaryByCustom = "ztest")] public ViewResult Index() { return View(); } My…
reZach
  • 8,945
  • 12
  • 51
  • 97
9
votes
1 answer

Use OutputCache and GetVaryByCustomString to cache same content for multiple paths

I have the following code in my MVC controller: [HttpGet] [OutputCache(Duration = 3600, VaryByParam = "none", VaryByCustom = "app")] public async Task Index(string r) { // Stuff... } And I have the following implementation of…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
9
votes
1 answer

How to set the S-MaxAge CacheControl value in an ASP.NET app?

I'm trying to set the cachability of an ASP.NET resource. So if I goto /foo/show it will show a View for some resource, and cache this for a few hours (for example). To do this, I'm using the OutputCache attribute which decorates my Action Method.…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
9
votes
1 answer

How to verify ASP.NET MVC OutputCache works on server?

I'm fixing a bug with ASP.NET OutputCache and it's driving me insane. We want caching on the server, but it does not appear to work (it did a while ago, in an older version of our app, but we discovered the bug by accident recently). Locally, I just…
MarioDS
  • 12,895
  • 15
  • 65
  • 121
1 2
3
45 46