Necati ÜNLÜ created FREEMARKER-220:
--------------------------------------
Summary: Can't change the setting template_update_delay above
1000ms
Key: FREEMARKER-220
URL: https://issues.apache.org/jira/browse/FREEMARKER-220
Project: Apache Freemarker
Issue Type: Bug
Affects Versions: 2.3.31, 2.3.32
Environment: macOS Catalina Version 10.15.7 (19H15), Eclipse Java /
WebObjects
Reporter: Necati ÜNLÜ
We're currently developing a web application that dynamically generates pages
using FreeMarker. In an effort to improve processing performance, we discovered
the template caching feature and its associated delay setting, which FreeMarker
uses to evaluate whether a cached template is stale or not.
In our processing logs, we noticed that template lookup consumes approximately
30% of FreeMarker's processing time. Our custom loaders' overridden methods are
called for each template, even if they're the same, which led us to believe
there was an issue with caching.
To test this, we manually set a delay and saw the same template being searched
multiple times when the delay was exceeded, confirming our suspicion. We
attempted to increase the template update delay to better suit our needs, but
regardless of the method used
{code:java}
configuration.setTemplateUpdateDelay(3600);
configuration.setTemplateUpdateDelayMilliseconds(3600000);
configuration.setSetting(Configuration.TEMPLATE_UPDATE_DELAY_KEY, "1 h");{code}
the delay value remains stubbornly at 1000ms. It's worth mentioning that we
were only able to change this value to a number less than 1000ms, even when the
value was negative.
This is odd, as the default value stated in the FreeMarker documentation is
5000ms. Whether we checked using
{code:java}
configuration.getTemplateUpdateDelayMilliseconds();
configuration.getSetting(Configuration.TEMPLATE_UPDATE_DELAY_KEY);{code}
or even via Eclipse's debug mode, the result is consistently 1000ms, even when
the check is made immediately after the delay setting instruction.
Despite our thorough search, we found no other interaction with this delay
elsewhere in our code. We also confirmed that the page templates are indeed
being added to the cache via debugger.
In light of the above, we're reporting this potential bug, as we are unable to
adjust the template update delay setting above 1000ms. We look forward to your
assistance in resolving this issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)