outputcache

ASP .Net Output Caching and Ajax Control toolkit

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" VaryByPara...

ASPX That Returns An Image - Output Cache-able?

Greetings! I've created an APSX web form that returns a remote image based on some supplied parameters. It can be used like this: <img src="/ImageGetter.aspx?param1=abc&param2=123" /> ImageGetter.aspx's markup and code look similar to this: <%@ OutputCache Duration="100000" VaryByParam="*" Location="ServerAndClient" %> <%@ Page Lan...

ASP.NET MVC - Caching Forms

More out of curiosity than anything. Do you think it'd be good practice to cache form pages? I've got a form that has a dropdown box that is populated from a rather hefty SQL call and takes a bit too long to load (from my shared hosting site). It's a simple form that when submitted just saves a bit of data to the database. I'm thinkin...

Debugging OutputCache in ASP.Net

I am not sure why I cannot get simple output cache to work and not sure of how to debug a situation like this. Simply from looking at examples and previous projects I have worked on, I used the following code: <%@ OutputCache Duration="100" VaryByParam="id" %> but since that didn't work I tried VaryByParam="*" and VaryByParam="none" ...

ASP.Net OutputCache: User Controls That Are Cached

Is there a way to obtain a list of User Controls (an/or instances of user contols) that have been cached? The Cache object's collection doesn't seem to include OutputCached items. Thank you. ...

Vary by control properties using PartialCaching in ASP.NET

I am using the PartialCaching attribute on the base class of a user control. I would like the cached controls to vary based on the properties set on the control instance. For example: <mycontrols:control1 runat="server" param1="10" param2="20" /> ...output would be cached separately from a control instance with different properties:...

Substitution Control and Cache Location

If I use Substitution control in asp.net page, and also add the following directive to the page: <%@ OutputCache Duration="7200" VaryByParam="None" Location="Any" %> Would the location attribute be ignored, since using Substitution control on a page makes the page cacheable only on the server? ...

programatically control output caching - disable or enable cache according to paramater value

We've got a fairly standard e-commerce scenario with paged lists of products within categories. For better or worse, about 80% of visitors never navigate past the first page, depending on the category there may then be 5-10 more pages of results which are viewed far less often. (Yes we do optimise what appears on the first page and have ...

Cache problem with DropDownList and VaryByControl

I have a page with a single dropdown. Depending on what the user chooses in this dropdown, a pretty huge report is generated. The cache directive for the page reads: <%@ OutputCache Duration="14400" VaryByParam="none" VaryByControl="lstUsers" %> The drop-down is defined as: <asp:DropDownList ID="lstUsers" runat="server" AutoPostBack=...

How do I know if the OutputCache for a given control is being used?

I am attempting to write a common "menu.ascx" usercontrol in Asp.Net MVC that will generate a properly formatted HTML menu for my application. The menu is generated based on content in the database and a series of Resource resolutions... which are passed to the PartialView through an attribute on a ViewModel. It would make sense to ut...

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

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 OutputCach...

ASP.NET OutputCache and postbacks

Hi, I'm trying to understand the ASP.NET OutputCache mechanism. I built a test page with a Label and LinkButton. The label text is being initialized on the server with the current server date on every PageLoad: protected void Page_Load(object sender, EventArgs e) { lblDate.Text = DateTime.Now.ToString(); } I used this ...

ASP.net - Caching by Query-String (VaryByParam)

In which situations should we use Query-Strings (VaryByParam) to achieve Caching in ASP.NET? Can anyone give an example of a real-life situation in case of an web-application? ...

Abort OutputCache duration programatically in asp.net mvc

Hi, 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 programatically? Thanks ...

.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 internally in the class/WebMethod? ...

Can ASP.NET outputCacheProfiles be used with Response.Cache?

When using the @OutputCache directive, you can define cache profiles as follows in web.config: <system.web> <caching> <outputCacheSettings> <outputCacheProfiles> <add name="myprofile" duration="30" enabled="true" varyByParam="myfield"/> </outputCacheProfiles> </outputCacheSettings> </caching> </system.web...

Clear ASP.NET OutputCache across web applications

Is it possible to clear the output cache of one asp.net web application from inside another asp.net web application? Reason being... We have several wep applications structured like... http://www.website.com/intranet/cms/ http://www.website.com/area1/ http://www.website.com/area2/ Pages in /area1/ and /area2/ are cached and are mana...

Caching not working right in my ASP.NET MVC website?

Hi folks, i'm trying to use OutputCaching in my ASP.NET MVC website. Problem is, when i try and change the value of one my querystring params, it's returning the data for the first item that was requested! Here's my code (with the param names changed) ... [ApiAuthorize] [HandleErrorAsJson] public class SearchController : Controller {...

ASP.Net MVC - Is it posible to gzip before putting data in cache

Hi guys Just wondering if anyone knows whether its possible to gzip results before putting the data in the cache...Note I am wanting to use a CompressAttribute I have and the built-in OutputCacheAttribute. I'm pretty sure its possible, because I have heard Jeff A. talking about it on a couple of podcasts... I know I can sort of change...

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

Hi folks, 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 ASP.NET Output Cache magic. Here's some sample code :- [AcceptVerbs(HttpVerbs.Ge...