Turn off caching for admins?
Is there a way to turn of caching by role? I want to turn it off for admins because it makes editing the site deceptive. Caching sticks even though admins made changes so it does not make sense for them.
Hello Basem,
That's a tough one - we do not offer such functionality. You'll have to either turn it off or choose/setup your own caching profile that responds to your caching requeremetns. If you have any additional questions, please write back.
Regards,
Boyan Barnev
the Telerik team
Dear Basam
I have set caching to 5 min sliding. I crated a simple widget with a label and the time to test the caching.
The time stays, but if I repubish a page the changes are reflected immediately.
What kind of chaing do you have?
Markus
Thanks Markus and Boyan. It seems when I update the template of a page, the changes are not reflected on the frontend until I explicitly go into the page and re-publish it (or the caching runs out). Then the changes of the template kick in.
Have you upgraded your 4.1 to 4.1 SP1
Because that was one of the fixes in SP1
Subscribe for the telerik Product Updates RSS feed
Release Notes – 4.1 SP 1
Markus
This site is running 4.1, I will try upgrading to SP1 and report if the problem persist. Thanks a mil Markus!
Guys,
I'm running into a development headache.
I've used advanced settings to enable all of the "No Cache" settings and disable all of the caching, however, when I try modify a user control via Studio (running Cassini) it seems to cache my UserControl until I stop Cassini and restart it.
This greatly increases the time it takes for me to debug and build new functionality.
How can I force Sitefinity to only use the version of my UserControl that I am actively developing upon?
Thanks!
Joel
Anybody?
Hello Joel,
You can try implementing CacheSubstitution for that control, please take a look at this article from ASP.NET, and let us know if the functionality described suits your needs.
Best wishes,
Boyan Barnev
the Telerik team
I had similar concern but when upgraded from 4.1 to 4.1 SP1, the problem was fixed. I hope the upgrade works for you too.
'would be sweet if there was a cache substitution layout control :)
Just to clarify, for myself:
The substitution control would correct any issue's I had with markup emitted on a user control.
What I'm experiencing is the desyncronization of my <usercontrol>.asxc.cs (the code behind) for my user controls. I don't know if it's a function of .net 4 or Sitefinity, but after a control successfully loads, I must stop and restart my web server in order for it to see my changes to user control.
Workflow to reproduce:
Create a new user control with a label:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TestControl.ascx.cs" Inherits="OSCPA.Web.UI.TestControl" %>
<
asp:Label
ID
=
"lblSomeText"
runat
=
"server"
></
asp:Label
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
namespace
OSCPA.Web.UI
public
partial
class
TestControl : System.Web.UI.UserControl
protected
void
Page_Load(
object
sender, EventArgs e)
lblSomeText.Text =
"Some Text"
;
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
namespace
OSCPA.Web.UI
public
partial
class
TestControl : System.Web.UI.UserControl
protected
void
Page_Load(
object
sender, EventArgs e)
lblSomeText.Text =
"Some Different Text"
;
Hello,
Caching is turned off by default for Administrators, in Sitefinity 4.2.
Best wishes,Georgi,
Am I correct in assuming that the <usercontrol>.ascx.cs files are being cached somewhere in Sitefinity (perhaps as widget templates)?
I haven't dug thru reflector to find anything. I'm only commenting on my external findings, it could very well be a function of Studio 2010; for all I know.
Thank you!
Joel
Hello Joel,
We have implementation for output cache. This means that we cache the page and when you modify it and publish it we invalidate the cache. The page is not cached when you have browse and edit mode or you have explicitly disabled the page cache.
Regards,
Ivan Dimitrov
the Telerik team
Hi Ivan,
So, at no point, does Sitefinity cache the <usercontrol>.ascx.cs file? Do you find that in your development of user controls you have to restart IIS/Cassini between saves of the codebehind in order to show a change?
Thanks!
Joel
Hello Joel,
This is required if you use a web application, because it needs ti be recompiled. For websites the changes should take effect immediately.
All the best,
Ivan Dimitrov
the Telerik team
Hey Ivan,
I'm sorry, but we used web sites (not web applications) with sitefinity 3.7 and we did not have to restart our local web servers between every changes. I'm just trying to understand why I need to do this as it just takes extra time between iterations with my clients.
Perhaps my issue is my own setup? In my screenshot you should be able to see that I'm using a web site (not application) and my build options.
Thanks for your patience,
Joel
Hello Joel,
Just to clarify something, since it could be helpful for you:
So, at no point, does Sitefinity cache the <usercontrol>.ascx.cs file? Do you find that in your development of user controls you have to restart IIS/Cassini between saves of the codebehind in order to show a change?
If a page or a control is cached, this means that actually the page/control's markup is cached, but not the server side logic. This means that if you request a cached resource, Sitefinity/Asp.Net will give you back only the previously saved markup - it will not execute the code in the .cs , nor will process the control or page lifecycle.
Your project is opened as a web site, and there is nothing wrong in that. You can just refresh the page when you make changes, and you don't need to recompile.
Georgi,
Thank you, I believe that we're on the same page now.
What I'm saying is that, for some reason, I make a change to a code behind file, and after I save the file, My breakpoints are not hit, nor are my changes reflected in the markup that the web server emits. After a restart of IIS/Cassini, my changes are present. After I restart the web server, I can see my changes and my breakpoints are adhered to.
If this is some anomaly with my installation of Visual Studio 2010 or a function of .net 4, I do not know.
I just remember that, with Sitefinity 3.7 (and studio 2008), when I would make a change to C# code in code behind, the JIT compiler would pick up my changes on my next request for a page that contained my user control, this doesn't seem to be the case any more.
Could you try the steps that I mentioned above? If it's my own installation that's at fault or some plugin that is causing this, then I apologize! I just have a co-worker with the same issue and I can't track it down.
Thank you again for your patience!
Joel
Hi Joel,
What I'm saying is that, for some reason, I make a change to a code behind file, and after I save the file, My breakpoints are not hit, nor are my changes reflected in the markup that the web server emits. After a restart of IIS/Cassini, my changes are present. After I restart the web server, I can see my changes and my breakpoints are adhered to.
This is because the markup, the template is cached and the web server returns it when you request the URL. When you restart the server, the cache is invalidated, and the changes take effect. This is not an anomaly.
I just remember that, with Sitefinity 3.7 (and studio 2008), when I would make a change to C# code in code behind, the JIT compiler would pick up my changes on my next request for a page that contained my user control, this doesn't seem to be the case any more.
This means that the 3.7 page was not cached. 3.x had the cache disabled by default, while in 4.x the cache is enabled. If you disable the page cache on that particular page, you will see the same effect as in 3.x.