More in this section

Forums / General Discussions / Turn off caching for admins?

Turn off caching for admins?

21 posts, 0 answered
  1. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    17 May 2011
    Link to this post
    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.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    30 Oct 2017
    20 May 2011
    Link to this post
    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
  3. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    20 May 2011
    Link to this post
    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
  4. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    20 May 2011
    Link to this post
    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.
  5. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    20 May 2011
    Link to this post
    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


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

      Markus

  6. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    20 May 2011
    Link to this post
    This site is running 4.1, I will try upgrading to SP1 and report if the problem persist. Thanks a mil Markus!
  7. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    21 Jul 2011
    Link to this post
    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
  8. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    29 Jul 2011
    Link to this post
    Anybody?
  9. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    30 Oct 2017
    01 Aug 2011
    Link to this post
    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
  10. Suella
    Suella avatar
    1 posts
    Registered:
    01 Aug 2011
    01 Aug 2011
    Link to this post
    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.
  11. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    02 Aug 2011
    Link to this post
    'would be sweet if there was a cache substitution layout control :)
  12. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    04 Aug 2011
    Link to this post
    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.
  13. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    04 Aug 2011
    Link to this post
    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
  14. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    04 Aug 2011
    Link to this post
    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
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Aug 2011
    Link to this post
    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
  16. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    04 Aug 2011
    Link to this post
    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
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Aug 2011
    Link to this post
    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
  18. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    04 Aug 2011
    Link to this post
    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
  19. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    04 Aug 2011
    Link to this post
    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
  20. Joel
    Joel avatar
    40 posts
    Registered:
    30 Nov 2010
    04 Aug 2011
    Link to this post
    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
  21. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Aug 2011
    Link to this post
    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
    21 posts, 0 answered