class DistributedCache implements Cache {

    @Override
    public ActionResponse put(String key, ActionResponse data) {
        try {
            final String serializedData = mapper.writeValueAsString(data);
            if (serializedData != null) {
                // Only cache if size is less that 32 KB
                if (serializedData.length() <= 32 * 1024) {
                    distributedMap.put(key, mapper.writeValueAsString(data));
                } else {
                    logger.error(
                            String.format("Size of response is too big for cache. Skipping it. Response Part : %s",
                                    serializedData.substring(0, 1024)));
                }
            }
        } catch (JsonProcessingException e) {
            logger.error("Error saving value to map: ", e);
        }
        return data;
    }

    public  DistributedCache(HazelcastConnection hazelcastConnection, String name, ObjectMapper mapper);

}