Eclipse modify the freemarker template service restart

In the actual project, every time you modify the ftl file, you have to restart tomcat to see the modified content.

 

Generally speaking, template files do not change very frequently. In a website with a lot of traffic, frequent reading of template files will cause a great burden on the system. Therefore, FreeMarker caches the content of template files to reduce templates. The frequency of file reading to reduce the system load.

 

When processing a template, FreeMarker directly returns the corresponding Template object from the cache, and has a default mechanism to ensure that the template object is synchronized with the template file.
In freemarker.properties, template_update_delay is used to specify the interval for updating the template file, which is equivalent to how long to check whether it is necessary to reload the template file, 0 means reload every time, otherwise, how many milliseconds to check whether the template has changed.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326486049&siteId=291194637