Details

    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      Idea is that this macro would cache the result of whatever wiki content is inside itself (thus including other macros).

      1. XWIKI-4322.patch
        26 kB
        Vincent Massol
      2. XWIKI-4322.patch
        26 kB
        Vincent Massol

        Issue Links

          Activity

          Hide
          Vincent Massol added a comment -

          Re your velocity example, I don't think the example is good because the first velocity macro will start by executing all velocity code (including the code in the nested cache macro) so you'll always incur penalty. Basically you shouldn't have a cache macro inside a velocity macro. The way the velocity macro work is:

          • Run velocity on the full content
          • Run the wiki parser on the result returned by velocity (macros are wiki syntax content)
          Show
          Vincent Massol added a comment - Re your velocity example, I don't think the example is good because the first velocity macro will start by executing all velocity code (including the code in the nested cache macro) so you'll always incur penalty. Basically you shouldn't have a cache macro inside a velocity macro. The way the velocity macro work is: Run velocity on the full content Run the wiki parser on the result returned by velocity (macros are wiki syntax content)
          Hide
          Ludovic Dubost added a comment -

          I agree with the fact that my example is bad and should be avoided.
          This strikes the need to have flexibility to define the cache KEY ID.
          It should be possible to have parameters specifying if the document name and the query string included in the key.
          By default I suggest the content/doc name/query strings are used in the cache key.

          Show
          Ludovic Dubost added a comment - I agree with the fact that my example is bad and should be avoided. This strikes the need to have flexibility to define the cache KEY ID. It should be possible to have parameters specifying if the document name and the query string included in the key. By default I suggest the content/doc name/query strings are used in the cache key.
          Hide
          Vincent Massol added a comment -

          First version done.

          Show
          Vincent Massol added a comment - First version done.
          Hide
          Sebastien KNOPF added a comment -

          CacheMacro doesn't seem to work on version 2.7.1.
          We have the following error message : Unknown macro: cache
          The "cache" macro is not in the list of registered macros. Verify the spelling or contact your administrator.

          Thank you

          Show
          Sebastien KNOPF added a comment - CacheMacro doesn't seem to work on version 2.7.1. We have the following error message : Unknown macro: cache The "cache" macro is not in the list of registered macros. Verify the spelling or contact your administrator. Thank you
          Hide
          Vincent Massol added a comment - - edited

          Indeed you're right, we've forgotten to package it.

          Right now you'll need to put the following in your WEB-INF/lib directory:
          http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macro-cache/2.7.1/xwiki-core-rendering-macro-cache-2.7.1.jar

          Thanks!

          Show
          Vincent Massol added a comment - - edited Indeed you're right, we've forgotten to package it. Right now you'll need to put the following in your WEB-INF/lib directory: http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macro-cache/2.7.1/xwiki-core-rendering-macro-cache-2.7.1.jar Thanks!

            People

            • Assignee:
              Vincent Massol
              Reporter:
              Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: