1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Using cache substitution with ASPNET caching

Using cache substitution with ASPNET caching

5 posts, 1 answered
  1. Hamza
    Hamza avatar
    8 posts
    Registered:
    20 May 2008
    22 Dec 2009
    Link to this post
    Hi Telerik,

    We've recently upgraded our website from Sitefinity 3.2 to 3.7.

    One of the reasons for us to do that was to use CacheSubstitutionUserControl to display logged-in user information and a sign-out link. Now to get this to work we of course have to switch the caching provider to ASPNET. And voila, the login information is displayed correctly and the Sign-out link appears correctly as well.

    However, caching on the rest of the content items just went bonkers. We have a blog on our site, which now keeps showing the first page of articles no matter which paging link you click on. If you click on any one post it opens up fine but subsequent post links show you the same post.

    Also our homepage has stopped working. We have a backup page ~/Default.aspx which will be displayed if the homepage (Default.aspx) is not published. After the upgrade, we cant see our homepage and keep seeing the backup page as if the request is not even going to Sitefinity.

    Can you please shed some light on the matter and point us in the right direction?

    Hamza
  2. Hamza
    Hamza avatar
    8 posts
    Registered:
    20 May 2008
    22 Dec 2009
    Link to this post
    UPDATE:
    We are also not able to edit the Homepage in Sitefinity as it is showing as the backup page. So we tried to Duplicate the page and save it with another URL (Default_copy1.aspx). This page works fine and shows everything as expected. However, now if I delete the old homepage and change the Default_copy1.aspx to Default.aspx, it starts to show the backup page again.

    Hope this info helps.
  3. Hamza
    Hamza avatar
    8 posts
    Registered:
    20 May 2008
    22 Dec 2009
    Link to this post
    UPDATE:
    I solved the homepage issue. It seems the Set as homepage flag disappeared after the upgrade. So I went in Sitefinity and set the my Homepage as homepage and it works. Weird why that happened though.

    The only thing left now is the caching of the blogs.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Dec 2009
    Link to this post
    Hello Hamza,

    Most probably you have not merged the Global.asax file. Could you verify that you have the exact method there as shown below:

    Global.asax


    public override string GetVaryByCustomString(HttpContext context, string custom)
    {
        if (custom.Equals("cms"))
        {
            return String.Concat(context.Request.RawUrl, context.Request.Browser.Type).ToLower();
        }
        return base.GetVaryByCustomString(context, custom);
    }

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  5. Hamza
    Hamza avatar
    8 posts
    Registered:
    20 May 2008
    22 Dec 2009
    Link to this post
    That did solve the issue. Thanks a ton. Appreciate your prompt reply.
Register for webinar
5 posts, 1 answered