Is there an option to do getBulk from cache with spring cache

216 Views Asked by At

I'm using Spring's caching abstraction in my application and the underlying cache is memcached.

memcached supports bulk lookup from cache by providing a collection of keys. see getBulk() javadoc here

However spring cache interface doesn't allow bulk lookup ? Is there a specific reason or are there ways to perform this?

1

There are 1 best solutions below

0
Stephane Nicoll On BEST ANSWER

The cache API is a base model to help us provide declarative caching, it is not meant to abstract every possible use of caching.

Each cache implementation has a getNativeCache that returns the underlying library implementation. If you need access to a library specific feature, that's what you should use.