Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Play! 2 - Cache.remove

http://www.playframework.org/documentation/2.0.2/JavaCache

Atm i can't find the Cache.remove method. I guess it's not implemented yet?

Then I would need to use a 3rd party library cache solution such as memcached for now.

// 2.0 final
Cache.set("item.key", null, 0)
// later
Cache.remove("item.key")
like image 695
Maik Klein Avatar asked Aug 06 '12 21:08

Maik Klein


People also ask

Where is Java cache located?

The Java cache directory is located in the following location: C:\Users\Anubhav\AppData\LocalLow\Sun\Java\Deployment\Cache.

How does caffeine cache work?

Caffeine provides flexible construction to create a cache with a combination of the following optional features: automatic loading of entries into the cache, optionally asynchronously. size-based eviction when a maximum is exceeded based on frequency and recency.

Is caffeine cache distributed?

Caffeine is a high performance, near optimal caching library and is an alternative to Ehcache for use with monoliths in JHipster. Similar to Ehcache, Caffeine cannot work as a distributed cache.


1 Answers

Although it's totally unclear it can be read as:

Since Play 2.0 final to remove cache entry use:

Cache.set("item.key", null, 0);

(it will set cache for item.key with null value, which will expire after 0 seconds)

'later' means that somebody forgot to add this method and it will be added later ;)

Edit:

This issue is already addressed in Play's Lighthouse

like image 93
biesior Avatar answered Oct 03 '22 21:10

biesior