I'm using an outputcache page directive to cache values based on VaryByParam. Is there a way I can prepopulate the cache when the web application starts up for a set of common params, instead of having to wait for a user to hit the page? Or do I just need to write a script that hits all the pages I want cached? Ideally, I can do it serv...
We have several sites that are mostly content managed using a sql database backend. these sites are most of the time serving up static information unless users change the content by voting or updating (similar to SO). These sites all have master pages where user specific information is often displayed at the top of each page (also simi...
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 uc1.ascx or page1.aspx?
When the OutputCache is in page1.aspx, I can use the following...
We have an ASP.NET application in which on the master page we have a user control that displays the most recently accessed entities by the user. To prevent database trips for every page load, we have enabled the caching for this user control by setting the outputcache directive as follows:
<%@ OutputCache Duration="1200" Shared="true" ...
I read somewhere that for a high traffic site (I guess that is a murky term as well), 30 - 60 seconds is a good value. Obviously I could do a load test and vary the values, but I couldn't find any kind of documentation on this. Most samples have a minute, a couple of minutes. There's no recommended range. Is there something on msdn or...
Hi,
for my current project it's necessary to generate dynamic CSS...
So, i have a partial view which serves as a CSS deliverer... The controller code looks like this:
[OutputCache(CacheProfile = "DetailsCSS")]
public ActionResult DetailsCSS(string version, string id)
{
// Do something with the version and id here.....
The problem: I am unable to use OutputCaching with my controls which derives from MyCustomControl. Controls are loaded dynamically using definitions from database with Page.LoadControl method.
When I add to ascx <%@ OutputCache VaryByParam="*" Duration="3600"%> the
"InvalidCastException: System.Web.UI.PartialCachingControl -> MyCustom...
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 cache if id == null but with a different duration.
I think I can achieve this by:
pu...
Hi All,
I have an ASP.NET application which requires output caching. I need to invalidate the cached items when the data returned from a web service changes, so a simple duration is not good enough.
I have been doing a bit of reading about cache dependencies and think I have the right idea. It looks like I will need to create a cache d...
For my case, i have a controller, which query then forward the user using RedirectResult, which actually did a header "Location".
Then i apply the cache to the controller like this
[OutputCache(Duration = int.MaxValue, VaryByParam = "none", NoStore=false)]
I try to re-run the page, and I check on my Linq profiler, I still able to see...
I am trying to do this, and it leads to result with contentlen 0
It looks like:
[OutputCache(Duration = 36000)]
public JsonResult GetFileClasses()
{
return this.Json(TopicConfig.FileExtensionsSettings.List)
}
Any ideas?
...
I have an action that returns a view with a master page with a logon user control at the top. When I set outputcache, it caches the entire output including the current user, so everybody would see whoever was the last person to hit the page to refresh the cache as the current user. Is there a way to prevent the master page from being i...
I have an ASP.NET MVC application. I need to cache some actions (pages) however for some pages I need do such only for non authenticated users.
I've tried to user VaryByCustom="user" with following GetVaryByCustomString implementation.
public override string GetVaryByCustomString(HttpContext context, string custom)
{
if (custom == "u...
Let's say that, theoratically, I have a page / controller action in my website that does some very heavy stuff. It takes about 10 seconds to complete it's operation.
Now, I use .NET's outputcache mechanism to cache it for 15 minutes (for examle, I use [OutputCache(Duration = 900)]) What happens if, after 15 minutes, the cache is expired...
I'm looking for a way to cache a page at both the client and the server while varying the server's output cache by a querystring parameter "Version".
With this tag:
<%@ OutputCache Duration="10" Location="Any" VaryByParam="none" %>
I get these headers:
HTTP/1.1 200 OK
Cache-Control: public
Content-Type: text/html; charset=utf-8
Expi...
Hi,
I'm using routing from System.Web.Routing without MVC in a standard ASP.Net Web Application Project application. This is mostly done to get neater urls in the portal we are developing (instead of ~/default.aspx?contentid=123 we have ~/{contentsubject}. The portal is not authorized and all info is in the url so in a caching scenario ...
If I had two servers using a single sqlserver instance as the session state, and I enable outputcache in the page, do you know if the database is hit on every request?
Since the outputcache is being used to respond the request, I asume is not needed, but if the session is being retrieved before the outputcache flag is checked, then the ...
http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx
To the sake of simplicity, please try out this. Basically, I am trying to do the mobile view engine, but then i found out that I have outputcache, which will cache one of 2 view (PC view) and then when i tried to access through mobile, it ...
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 ...
Is there any way that I can list the pages which are currently stored in the OutputCache?
Just a list of paths would do, but if there's a way to get more information about each item (expiry etc), then all the better.
...