Turn off caching for admins?

Posted by Community Admin on 03-Aug-2018 15:19

Turn off caching for admins?

All Replies

Posted by Community Admin on 17-May-2011 00:00

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.

Posted by Community Admin on 20-May-2011 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 20-May-2011 00:00

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

Posted by Community Admin on 20-May-2011 00:00

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.

Posted by Community Admin on 20-May-2011 00:00

Have you upgraded your 4.1 to 4.1 SP1

Because that was one of the fixes in SP1

Version Notes

Sitefinity 4 4.1 1395

Subscribe for the telerik Product Updates RSS feed

    Release Notes – 4.1 SP 1


    • Templates: Updating a template is not reflected on the page until the page is republished (PITS)

     

    Markus

    Posted by Community Admin on 20-May-2011 00:00

    This site is running 4.1, I will try upgrading to SP1 and report if the problem persist. Thanks a mil Markus!

    Posted by Community Admin on 21-Jul-2011 00:00

    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

    Posted by Community Admin on 29-Jul-2011 00:00

    Anybody?

    Posted by Community Admin on 01-Aug-2011 00:00

    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

    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Posted by Community Admin on 01-Aug-2011 00:00

    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.

    Posted by Community Admin on 02-Aug-2011 00:00

    'would be sweet if there was a cache substitution layout control :)

    Posted by Community Admin on 04-Aug-2011 00:00

    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";
            
        

    Add that new control to Sitefnity's Toolbox.config file
    Create an empty page and add the user control to the page
    Publish
    View the page
    Make a change to the code of the control
    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";
            
        
    Save your change in studio and refresh the page.

    In Visual studio, my new code behind no longer matches what sitefinity is emitting, so my breakpoints are not hit.

    In order for my breakpoints to be hit, I must stop Cassini (or IIS7) and restart it.

    Posted by Community Admin on 04-Aug-2011 00:00

    Hello,

    Caching is turned off by default for Administrators, in Sitefinity 4.2.

    Best wishes,
    Georgi
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Posted by Community Admin on 04-Aug-2011 00:00

    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

    Posted by Community Admin on 04-Aug-2011 00:00

    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

    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Posted by Community Admin on 04-Aug-2011 00:00

    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

    Posted by Community Admin on 04-Aug-2011 00:00

    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

    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Posted by Community Admin on 04-Aug-2011 00:00

    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

    Posted by Community Admin on 04-Aug-2011 00:00

    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.

    All the best,
    Georgi
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Posted by Community Admin on 04-Aug-2011 00:00

    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

    Posted by Community Admin on 10-Aug-2011 00:00

    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.

    Regards,
    Georgi
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    This thread is closed