Cache miss doesn't much with put

13 views
Skip to first unread message

Zekariyas Kassa

unread,
Jul 27, 2018, 3:25:17 PM7/27/18
to simple-spring-memecached
I am seeing a significant number of cache misses when using SSM with Spring. I am using @Cacheable, @CachePut, @CacheEvit with a custom key construction method specified as SpEL. 

@Cachable(value="PERSON", key="#root.target.construct(#name, #age)", unless="result == null")
Person getPerson(String name, int age){
//
}

My construct method just removes spaces and concatenate all the parameters by "," and returns.

Please help. Thanks

Jakub Białek

unread,
Jul 28, 2018, 3:50:29 AM7/28/18
to simple-spring-memecached
Hi,

Do you see the same behavior when using org.springframework.cache.support.SimpleCacheManager instead of SSM?

-- Ragnor 

--
You received this message because you are subscribed to the Google Groups "simple-spring-memecached" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-spring-memecached+unsub...@googlegroups.com.
To post to this group, send email to simple-spring-memecached@googlegroups.com.
Visit this group at https://groups.google.com/group/simple-spring-memecached.
For more options, visit https://groups.google.com/d/optout.

Zekariyas Kassa

unread,
Aug 10, 2018, 2:57:43 AM8/10/18
to simple-spring-memecached
It turns out there are methods that return null value and null values are not being cached since I am using "unless == null" constraint on the annotation. What this means is that get cache will give null but when it tries to cache null value it can't. Hence, the numbers don't match. Bottom line SSM is doing its job. Thanks


On Saturday, July 28, 2018 at 12:50:29 AM UTC-7, ragnor84 wrote:
Hi,

Do you see the same behavior when using org.springframework.cache.support.SimpleCacheManager instead of SSM?

-- Ragnor 
On 27 July 2018 at 21:25, Zekariyas Kassa <k.zbe...@gmail.com> wrote:
I am seeing a significant number of cache misses when using SSM with Spring. I am using @Cacheable, @CachePut, @CacheEvit with a custom key construction method specified as SpEL. 

@Cachable(value="PERSON", key="#root.target.construct(#name, #age)", unless="result == null")
Person getPerson(String name, int age){
//
}

My construct method just removes spaces and concatenate all the parameters by "," and returns.

Please help. Thanks

--
You received this message because you are subscribed to the Google Groups "simple-spring-memecached" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-spring-memecached+unsub...@googlegroups.com.
To post to this group, send email to simple-sprin...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages