Relative Content

Tag Archive for javacaching

caching large files to avoid frequent remote retrieval

I’m looking for some ideas or frameworks for dealing with caching large files. The goal is to avoid repeatedly calling a remote data source (rest service) to retrieve file whose size is few hundreds megabytes or even gigabytes, if possible. One I can think of is to retrieve the file and then cache the path after the file is downloaded to the local filesystem. The next time when the file is needed, cache manager can look at the cache, return the path if the file exists and get it directly from the local filesystem with it.

What approach should follow to solve Cache issue in spring boot

I have the following code for getting data from db.
@Cacheable()
public List getAllSystem(String client,Integer pageNumber,Integer pageSize,String sortBy, String sortDirection)
{
Pageable p=PageRequest.of(pageNumber,pageSize,sort);
Page sys=sysDao.findAll(p);
List allsys=sys.getContent();
return allsys;
}