Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 实现REST资源的缓存_Spring_Rest_Caching - Fatal编程技术网

Spring 实现REST资源的缓存

Spring 实现REST资源的缓存,spring,rest,caching,Spring,Rest,Caching,我想为在SpringBoot中实现的Rest服务实现缓存功能 我找到了不同的实现方法: 使用springs的缓存抽象(@cachable等),它使用HashMap在内存中进行内部缓存 将springs的缓存抽象(@cachable等)与缓存实现(如ehcache、caffee等)结合使用 我们需要设置缓存控制头及其不同属性的HttpCaching。 使用ETAG的HttpCaching 很难决定哪一个是最好的解决方案,为什么? 所有这些方式是否相互关联 请帮我解决这个问题

我想为在SpringBoot中实现的Rest服务实现缓存功能

我找到了不同的实现方法:

  • 使用springs的缓存抽象(@cachable等),它使用HashMap在内存中进行内部缓存
  • 将springs的缓存抽象(@cachable等)与缓存实现(如ehcache、caffee等)结合使用
  • 我们需要设置缓存控制头及其不同属性的HttpCaching。
  • 使用ETAG的HttpCaching
  • 很难决定哪一个是最好的解决方案,为什么? 所有这些方式是否相互关联

    请帮我解决这个问题