Why does Tomcat keep the cache in its works folder? Considering that almost all files are subject to change, such caching potentially carries risks.

    1 answer 1

    Tomcat does not mindlessly use cached classes. Before use, it compares the change time of the original file with the cached file, and if the source file was changed after creating the cache, the cached file is re-created. The cache is stored to speed up the processing of pages, because the operation of translating a JSP page to a servlet, followed by compilation and loading can take considerable time (depending on the size of the original JSP page). Also in the cache are added up the resources extracted from the libraries used in the application. These resources just can not change while the application is running, so the cache saves time spent on unpacking library archives.

    • and what resources are extracted from the libraries? - voipp
    • Everything, in addition to the classes that its developers sewed into the library. These can be properties-files, xml-configs, xsd-schemes or any other text or binary files necessary for the library to work. - fori1ton