-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Commercetools resources are versioned, so it is possible to cache resources, since in case the cache is outdated we get a version conflict from the platform and all we have to do is invalidate the outdated cache entry.
We can use both cache strategies, either local, or remote (redis or other cach providers). but at the same time we dont want to bind ourselves to a specific provider, this is why we can create a cache interface that we use in a middleware. and which abstract the cache (local and remote ) away.
maybe use javax.persistence.Cache, or create an interface similar to
public interface CtpCache {
Future<Object> upsert(String key, Object object);
Future<Object> get(String key);
void invalidate(String key);
}
public class CacheMiddleware {
public CacheMiddleware(CtpCache cache){
.....
}
} linked to #192
Metadata
Metadata
Assignees
Labels
No labels