4

I have a Spring based application that uses Spring core, Spring MVC and Spring Data (Mongo) on the server side, and designed as a typical 3-tier application.

I have a list of services, that are typical Spring services/beans that I wish you integrate with memcached to cache some of my service results.

Can someone guide me to the steps to integrate memcached with spring for such an application? A sample/tutorial/blog that gives a step by step process would be just great.

Thanks.

4

2 回答 2

4

如果您使用 Spring 3.1,请查看Spring Cache抽象。这是在 Spring 应用程序中集成缓存的最简单方法。不幸的是 Spring 不支持开箱即用的 memcached,只支持 ehcache。

据我所知,没有任何提供者可以通过 Spring Cache 将数据存储到 memcached 中。几天后,Simple Spring Memcached的下一个版本 3.0.0 将在此支持下发布。同时,您可以尝试最新的快照之一或直接使用 Simple Spring Memcached 2.0.0,而无需 Spring Cache 抽象。

更新:带有 Spring Cache 集成的简单 Spring Memcached 3.0.0 已经可用。

于 2012-07-25T05:20:35.640 回答
0

做起来很简单。您可以在github上查看3levelmemcache项目作为示例,它是基于 Spring 的抽象。

于 2014-08-18T17:20:22.810 回答