Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Garrett Fisher 341 posts 496 karma points
    Jul 25, 2013 @ 16:14
    Garrett Fisher
    2

    Macro Caching and Preview

    Does anyone know if Preview mode circumvents cached macros?  I am wondering, if I have all my macros set to a cache rate of say, 10 minutes, and I save and preview a page invoking these macros, will brand new content show up on the page in Preview mode?

    Thanks,

    Garrett

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jul 25, 2013 @ 16:51
    Chriztian Steinmeier
    1

    Hi Garrett,

    Excellent question - my immediate guess would be that they are separate - but who knows? I'll try to dig up an answer...

    /Chriztian

  • Stephen 767 posts 2273 karma points c-trib
    Jul 25, 2013 @ 18:28
    Stephen
    101

    From the 6.1 source,

            /// <summary>
            /// Returns the cached version of this macro either as a string or as a Control
            /// </summary>
            /// <param name="macroHtml"></param>
            /// <param name="macroControl"></param>
            /// <returns></returns>
            /// <remarks>
            /// Depending on the type of macro, this will return the result as a string or as a control. This also
            /// checks to see if preview mode is activated, if it is then we don't return anything from cache.
            /// </remarks>
            private void GetMacroFromCache(out string macroHtml, out Control macroControl)
            {
                macroHtml = null;
                macroControl = null;

                if (UmbracoContext.Current.InPreviewMode == false && Model.CacheDuration > 0)
                {

    So... would say that the entire macro cache is bypassed when previewing.

    Stephan

  • Garrett Fisher 341 posts 496 karma points
    Jul 25, 2013 @ 19:04
    Garrett Fisher
    0

    Nice one!  The results of my testing indicated the same.  Thanks to both you and Chriztian!

  • Sandor 13 posts 36 karma points
    Jun 30, 2014 @ 18:23
    Sandor
    1

    Hi,

    Just found out that although getting a macro from cache is not done in preview mode, the result of the macro is always cached, regardless of preview mode. So if you save and preview a page containing cached macros you will see the result of these macros on the live pages as well. This way non-published content can end up on your live website.

    I tested and verified this in the 6.1.6 source code.

    Sandor

  • Stephen 767 posts 2273 karma points c-trib
    Jun 30, 2014 @ 18:59
    Stephen
    1

    @Sandor: had a hard time believing what you wrote. Checked the code. And... looks like you're right. Don't even understand how that's possible. Will check again and create appropriate issue in YouTrack, and fix.

    Stephan

  • James Collins 13 posts 34 karma points
    Feb 19, 2015 @ 17:14
    James Collins
    0

    This still seems to be an issue in 6.2.4.  Here is the link on issues.umbraco.org:

    http://issues.umbraco.org/issue/U4-5162

    Let's get it voted up.  It must be affecting a large number of installations.  In the worst case, time-sensitive information may be leaking to live.

  • James Collins 13 posts 34 karma points
    Jun 09, 2015 @ 20:57
    James Collins
    0

    It doesn't look like this issue is assigned or due in any version yet.

    @Stephen: is there anything you can do to help this gain some traction?  It's becoming quite challenging to have to work around it.

     

  • Clickfarm 77 posts 161 karma points
    Jun 10, 2015 @ 18:23
    Clickfarm
    0

    This issue is also affecting my sites running 7.2.1. Can we please get a fix for this on the roadmap for next release?

    Look like an issue has been reported but doesn't look like anyone is working on fixing it.

    http://issues.umbraco.org/issue/U4-5162

    thanks.

  • Stephen 767 posts 2273 karma points c-trib
    Jun 15, 2015 @ 12:46
    Stephen
    0

    Fixed in 7.3.0 (see issue tracker).

Please Sign in or register to post replies

Write your reply to:

Draft