thymeleaf / thymeleaf-spring

Thymeleaf integration module for Spring
http://www.thymeleaf.org
Apache License 2.0
434 stars 156 forks source link

Use Spring Cache Abstraction #89

Open candrews opened 9 years ago

candrews commented 9 years ago

In my opinion, when SpringTemplateEngine is used, one would expect Thymeleaf to use Spring's cache abstraction (SpringTemplateEngine already causes Thymeleaf to use other Spring features/components, so why not cache?).

Can this feature be added? I've figured out how to do that and written up how to make that happen, along with the code: http://candrews.integralblue.com/2015/07/using-spring-cache-as-the-thymeleaf-cache/ It seems like it would be a fairly simple change to SpringTemplateEngine - perhaps this could be in Thymeleaf 3.0?

danielfernandez commented 8 years ago

I'm leaving this in the Wish List for now. I agree that integrating with Spring's own caching infrastructure looks interesting, but the nature of Thymeleaf's cached artifacts (mostly templates --- expressions are not a problem) and the impossibility to manage them as serializable structures might end up posing a series of problems with some cache implementations.

So for now I prefer to leave this under the direct responsibility of Thymeleaf, but I don't want to discard it, so let's leave it as an idea for future versions.

Thanks.