tags:

views:

18

answers:

1

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?

A: 

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.

Plaudit Design - Web Design