Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15406

Parsed LESS code in SSX objects always produces the same CSS, even with 'no caching' set

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Create the following SSX object:

      #if ("$!context.userReference" == '')
        /* guest user */
        #document-title {
          background-color: red;
        }
      #else
        /* registered user */
        #document-title {
          background-color: green;
        }
      #end
      

      ...with the following properties:

      Use this extension: On this page or on demand
      Parse Content: Yes
      Caching policy: no caching
      Content type: LESS
      

      View the page both with a guest user and a registered user (e.g. Admin). You will notice that as you log in and log out, the title will keep the same background color (depending on how it was evaluated the firs time), no matter if you have explicitly asked for no caching to be done on the evaluated code.

      However, if you change the Content type from LESS to CSS, you will see that it starts working correctly and, as you log in and log out, the correct styling is applied and the title background color changes.

      It is very likely that the LESS cache is not synchronized with the SSX object's caching policy and it is never invalidated.

      The only way to manually invalidate the LESS cache is to resave the page holding the SSX object, but it will only get re-cached with the state of the first request that it will get after that.

        Attachments

          Activity

            People

            • Assignee:
              atallahade Adel Atallah
              Reporter:
              enygma Eduard Moraru
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

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