outputcache

ASP .Net Output Caching and Ajax Control toolkit

心不动则不痛 提交于 2020-01-05 03:58:06
问题 I'd like to know if there's a special way of implementing output caching and using a control from the ajax control toolkit. I keep getting a javascript error on a page with output caching and a tab control that says: ajaxtoolkit (my assembly prefix) is undefined. This is the directive I added: <%@ OutputCache Duration="3600" VaryByParam="none" %> 回答1: Microsoft does not support output caching in combination with ScriptControls, Extenders, or ScriptManagerProxies that need ScriptReferences. A

Cache home page for non-authenticated users in ASP.NET MVC 3

跟風遠走 提交于 2020-01-03 16:06:04
问题 My website have a home page, and I would like to cache that page for anonymous users, and set it as "private" for authenticated users (so they save it on their computers, nowhere else). So, if the user is anonymous I want to save the page in the server cache, and also in the browser cache using Cache-control:public, max-age=60 and Vary:Cookie , so if the browser gets authenticated and send a cookie, the browser won't reuse the former stored page. If the user is authenticated, then I do not

Cache home page for non-authenticated users in ASP.NET MVC 3

醉酒当歌 提交于 2020-01-03 16:04:21
问题 My website have a home page, and I would like to cache that page for anonymous users, and set it as "private" for authenticated users (so they save it on their computers, nowhere else). So, if the user is anonymous I want to save the page in the server cache, and also in the browser cache using Cache-control:public, max-age=60 and Vary:Cookie , so if the browser gets authenticated and send a cookie, the browser won't reuse the former stored page. If the user is authenticated, then I do not

Conditional Cache using OutputCacheAttribute in Asp.net MVC 4

末鹿安然 提交于 2020-01-01 05:49:27
问题 I am trying to implement Output caching for my action results. In my actions depending upon some business rules response is returned. In my response I send error code. I do not want to cache the response if there is any error. Following in the Action Result class Response { public int ErrorCode { get; set; } public string Message { get; set; } } [OutputCache(CacheProfile = "Test")] public ActionResult Sample() { Response response = new Response(); return new JsonResult { Data = response,

Abort OutputCache duration programmatically in asp.net mvc

萝らか妹 提交于 2020-01-01 05:45:29
问题 I'm using the OutputCache attribute to cache my action's html output at the server-side. Fine, it works, but now I have a situation where the content changes rarely, but when it does, it's critical for the user to see the new data the very next request. So, is there a way to abort the page cache duration programmatically? 回答1: Yes, it is possible using HttpResponse.RemoveOutputCacheItem Method. Check this question: SO - How to programmatically clear outputcache for controller action method

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

你。 提交于 2020-01-01 04:29:10
问题 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: <img width="75" height="75" src="@Url.Action("GetImage", "Store", new {productId = item.ProductId})"/> I want to cache images on a Server. So, what I've already tried: 1) to use OutputCacheAttribute: [HttpGet, OutputCache(Duration = 10, VaryByParam = "productId",

How do I configure ASP.Net OutputCache to vary by http vs https?

ε祈祈猫儿з 提交于 2020-01-01 04:13:06
问题 Here is the scenario, a user opens up non-secure page from our WebApp, let's call it PageA, in their browser and then clicks a link in there that takes them to a secure instance of PageB. Once in PageB the user can subsequently click a link that takes them back to a secure instance of PageA (which they already viewed and is in OutputCache). I observed that even though PageA is being accessed over a different URL after visiting PageB (the secure one) it's actually pulling the prior cached copy

OutputCache returns invalid version with PostBack

喜你入骨 提交于 2019-12-31 03:08:28
问题 I am having a weird issue happening with outputcache. I have multiple user controls on a page, one of which is a login control. The page and the login control is NOT cached, but other user controls are cached with VaryByParam. Now all of this works along with caching when I click on to different pages. But as soon as I login, other user controls on that page display old cached versions. If I refresh the page, I get the correct cached version of all user controls. The problem is only when a

Caching strategy, Output Cache vs Data Cache or both?

穿精又带淫゛_ 提交于 2019-12-30 04:42:05
问题 I'm working on an ASP.NET MVC project and I've come to the point where I want to start considering my caching strategy. I've tried to leave my framework as open as possible for the use in caching. From what I heard during Scott Hanselman's podcast StackOverflow.com uses page output caching and zips that content and puts it into RAM. This sounds like this would be great for user-wide cache but for something like personalized pages you would have to cache a version for each user and that could

OutputCache Bug with VaryByParam=“None” with MVC RC refresh

笑着哭i 提交于 2019-12-24 22:51:54
问题 Came across to this defect with ASP.NET RC refresh while using VaryByParam="" instead of VaryByParam="None" . Caching WORKS, but page http://www.yoursite.com and http://www.yoursite.com/home/index will be cached separately it seems. What is the difference between VaryByParam="" and VaryByParam="None" ? edit : I mean VaryByParam="" not VaryByParam="*" cause the bug still exists with VaryByParam="*" 回答1: VaryByParam="*" will create a new cache for every different parameter passed. VaryByParam=