Take the 2-minute tour ×


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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer


