Thanks for replay.
But I konw the principle  of cache,and I konw I can use Ehcache  or memcached.

I want to use memcached.

@GET
@Path("/bookCategory")
@Produces(MediaType.APPLICATION_XML)
public List<EBookCategory> bookCategory() {
     //here I can add cache code
List<EBookCategory> categorys=getFromCache()==null?getFromDb():getFromCache();
return categorys;
}

this way I just cache the result from db,and I still waste my cpu on parse the 
object to xml,I want to cache the xml,but this is done by the wink.
How can I cache the result generate by wink?

2011-11-22 



zhangpp 



发件人: Serafin Sedano 
发送时间: 2011-11-22  21:57:07 
收件人: wink-user 
抄送: 
主题: Re: How can I cache the result? 
 
Hi,


Take a look at Ehcache http://ehcache.org/documentation/user-guide/web-caching


Regards.


Serafín.


2011/11/22 zhangpp <[email protected]>

Hi everybody!

I want to add cache function to the web services.It's my code

@GET
@Path("/bookCategory")
@Produces(MediaType.APPLICATION_XML)
public List<EBookCategory> bookCategory() {
List<EBookCategory> categorys=...get from db;
return categorys;
}

but I don't want just cache the db result,I want to cache the final result(the 
xml generate by wink),how can I do it?

I'm using memcached and Simple-Spring-Memcached to do it.

thanks!


2011-11-22 



zhangpp 





-- 
Serafín Sedano | Software Engineer | Abiquo |  | [email protected]

Reply via email to