views:

97

answers:

2

Can I ship my application with compiled templates?

I there such a thing at all compiled templates in velocity? Or are they obligatorily recompiled on every run?

+3  A: 

Its my understanding that there is no "compiled" file format for Velocity templates. If its crucial to do so, one idea would be to compile the templates and serialize them out to disk. However, that seems quite hokey.

Perhaps you're solving the wrong problem, why do you wish to ship with the templates pre-compiled? What would that buy you over compiling your templates at boot time?

Kevin
+5  A: 

As Kevin mentioned, the templates are not compiled into any sort of file format.

However, you might want to look into options for caching the Velocity resources/templates so that Velocity will not attempt to load the template file from disk every time.

matt b