Java Cache Implementation in a web application

248 views Asked by At

I have a web application in which for each user I am creating a file and Storing the file in session as stream for certain operation to be performed after that and also I don't want to load the huge file again and again to perform some operations.

I want store the file in a cache instead of relying on the session for some reasons. After few research, I found lot of cache implementations which is getting complex and complex.

Which of the below cache implementations will be suitable for this scenario?

  1. LRU

  2. Time based(Expiry).

A simple LRU cache using ConcurrentHashMap is enough for my requirement? Is there any way to create LRU cache with expiry time?

0

There are 0 answers