From d568620060090702c0c539e70627be9e08fd021f Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Tue, 6 Oct 2020 21:44:43 +0300 Subject: [PATCH] UrlTemplateResolver: Add TTL configuration Signed-off-by: Pekka Helenius --- .../java/com/fjordtek/bookstore/BookstoreApplication.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java b/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java index 817c706..a25611f 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java @@ -59,8 +59,12 @@ public class BookstoreApplication extends SpringBootServletInitializer { public UrlTemplateResolver urlTemplateResolver() { UrlTemplateResolver urlTemplateResolver = new UrlTemplateResolver(); urlTemplateResolver.setCacheable(true); + + // TTL value in milliseconds + urlTemplateResolver.setCacheTTLMs(120000L); + urlTemplateResolver.getCharacterEncoding(); - return urlTemplateResolver; + return urlTemplateResolver; } @Bean