Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6677

Remove FTL 5sec cache in Developer mode

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 5.4.8, 5.5
    • 5.4.6
    • None
    • None
    • Yes
    • Yes
    • Basel 48
    • 2

      Currently FTL files are cached for 5 seconds when they are requested. In developer mode this should be removed to improve developer experience of the responsiveness of Magnolia to their changes. This will also enable using a "hot browser reload" mechanism like BrowserSync or LiveReload.

      Symptom:
      Change an ftl file. Refresh the webpage and see the change instantly.
      Change the ftl file again. Refresh the webpage before 5 seconds elapsed and you will not see the change. Only after 5 seconds have elapsed since the last change was rendered will the new change be rendered.

      Notes:
      freemarker.cache.TemplateCache sets the default refresh delay to 5s

      The 'FTL lock' problem is solvable by doing this at L123 in FreemarkerHelper:

       cfg.setTemplateUpdateDelay(0);

      As this change will negatively impact performance, it should only be appllied when developer mode is enabled.

      Documentation:
      Please document also in a section about all the changes that developer mode activates.

        Acceptance criteria

              ilgun Ilgun Ilgun
              czimmermann Christopher Zimmermann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD