API / Apache Velocity Interview questions
Explain the lifecycle of a Velocity template from load to render?
Rendering a template goes through a consistent sequence of stages inside the engine, whether it's the first request or the thousandth.
The expensive work, reading the file and building the AST, only happens once per template as long as caching is enabled and the source file's timestamp hasn't changed; every subsequent render reuses that cached AST and just walks it against a fresh Context. This is why keeping file.resource.loader.cache enabled matters so much for throughput: without it, the parse step repeats on every single render.
More Related questions...