mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 01:58:16 +08:00
Improve caching configuration
Rather than creating a `CacheManager` ourselves, we now rely on JCache to provide a `CacheManager` that we'll augment with the caches that initializr needs. If Initializr is embedded in another app and that app uses JCache, then its cache manager will be transparently upgraded to define the caches that initializr needs. If not, such caches will have to be created as part of the custom config. Also, caching only kicks in if required at the service level. This commit also switches the cache implementation to EhCache 3. See gh-389
This commit is contained in:
@@ -26,6 +26,15 @@
|
||||
<artifactId>initializr-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.cache</groupId>
|
||||
<artifactId>cache-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
|
@@ -23,6 +23,7 @@ import io.spring.initializr.web.project.LegacyStsController;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurerSupport;
|
||||
@@ -37,6 +38,7 @@ import org.springframework.web.servlet.resource.ResourceUrlProvider;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableCaching
|
||||
public class InitializrService {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
Reference in New Issue
Block a user