开发者

ehcache cache "streams" of data

I want to cache the response to image requests. The images are the results of dynamic resizing of a larger image.

I am using ehcache already for some caching. I would like to use it here.

I don't want ehcache to keep the开发者_开发知识库 resized image in memory; neither when cached or when being read in.

How do I make ehcache only store on disk (no memory storage)? I don't need it read into memory so how would I get an InputStream from ehcache?


There doesn't seem to be a way. I decided to store the information in a File and keep a reference to that File in the Element you give ehcache. Then I registered an event listener with the Cache that gets notified when the cache entry is being removed. On removal I delete the temp file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜