Daniel Dekany
2014-12-15 15:46:05 UTC
Yip, I know this problem, and I have just added a feature that targets
this and some more. Check out CachingUpperCaseDirective here:
https://github.com/freemarker/freemarker/blob/2.3-gae/src/test/java/freemarker/core/DirectiveCallPlaceTest.java
It will be a new feature in 2.3.22, which should be released in early
2015. So, for now you have to build it from the GitHub 2.3-gae branch
(it's important that it's the "gae" one), and please do so if you can,
and try to use it, and break it. I'm open for new suggestions of
course, until it's released.
(I would say that the 2.3-gae head is pretty safe to use in
production, in case waiting for the be release is a problem. The new
API-s and features can change a bit though.)
this and some more. Check out CachingUpperCaseDirective here:
https://github.com/freemarker/freemarker/blob/2.3-gae/src/test/java/freemarker/core/DirectiveCallPlaceTest.java
It will be a new feature in 2.3.22, which should be released in early
2015. So, for now you have to build it from the GitHub 2.3-gae branch
(it's important that it's the "gae" one), and please do so if you can,
and try to use it, and break it. I'm open for new suggestions of
course, until it's released.
(I would say that the 2.3-gae head is pretty safe to use in
production, in case waiting for the be release is a problem. The new
API-s and features can change a bit though.)
Hello all,
I'd thinking about how I could attain template "compile time generation"
optimizations the best way. Or maybe I'm just on the wrong track. Any
comments would be helpful.
I'm using Freemarker as html template engine. In that html I have
sometimes a few <script>-tags containing javascript. The javascript
could be optimized with one of numerous available optimization and
minification tools available. I was thinking about doing a
TemplateDirectiveModel that on the first run optimizes that code and any
calls thereafter only returns the optimized part. Is this a good way to
attain my goal (doing early, close to only once, expensive template
translation). Of course the code within has to be written so it doesn't
depend on anything that makes the code dynamic on each rendering.
As I said, any feedback on my thoughts would be greatly appreciated!
Have a great day!
//Jerker
I'd thinking about how I could attain template "compile time generation"
optimizations the best way. Or maybe I'm just on the wrong track. Any
comments would be helpful.
I'm using Freemarker as html template engine. In that html I have
sometimes a few <script>-tags containing javascript. The javascript
could be optimized with one of numerous available optimization and
minification tools available. I was thinking about doing a
TemplateDirectiveModel that on the first run optimizes that code and any
calls thereafter only returns the optimized part. Is this a good way to
attain my goal (doing early, close to only once, expensive template
translation). Of course the code within has to be written so it doesn't
depend on anything that makes the code dynamic on each rendering.
As I said, any feedback on my thoughts would be greatly appreciated!
Have a great day!
//Jerker
--
Thanks,
Daniel Dekany
Thanks,
Daniel Dekany