diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/server/configuration/WwwAppConfiguration.java | 2 | ||||
-rw-r--r-- | src/main/java/com/juick/service/TagService.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java b/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java index 45950eb0..66f1d8ce 100644 --- a/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java +++ b/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java @@ -63,7 +63,7 @@ public class WwwAppConfiguration implements WebMvcConfigurer { private String imgDir; @Bean public CacheManager cacheManager() { - return new CaffeineCacheManager("help", "users_by_name", "discussions", "messages", "replies"); + return new CaffeineCacheManager("help", "users_by_name", "discussions", "messages", "replies", "popular_tags"); } @Bean diff --git a/src/main/java/com/juick/service/TagService.java b/src/main/java/com/juick/service/TagService.java index 489f405a..ca4b665e 100644 --- a/src/main/java/com/juick/service/TagService.java +++ b/src/main/java/com/juick/service/TagService.java @@ -21,6 +21,7 @@ import com.juick.Tag; import com.juick.User; import com.juick.model.TagStats; import org.apache.commons.lang3.tuple.Pair; +import org.springframework.cache.annotation.Cacheable; import java.util.Collection; import java.util.List; @@ -44,6 +45,7 @@ public interface TagService { List<String> getUserBLTags(int uid); + @Cacheable(value = "popular_tags") List<String> getPopularTags(); List<TagStats> getTagStats(); |