quiz

Full-stack dev quiz question #63

Full-stack dev quiz question #63quiz

Caching may save performance of your system. For example, Caffeine Cache is one of powerful cache libraries that offer various configuration options. Speaking of options... do you know how to configure Caffeine Cache? Check sixty second question of full-stack dev quiz to check it.

 

 

Caffeine Cache is a library, that you can just use it instead of creating your own cache implementation. If you are already familiar with it, do you know which CaffeineCacheManager option to use, to meet the following requirements?

  • If requested for the first time, don't use cache, get it in the regular way (from a database or calculate it).
  • If it was added to the cache no longer than 1 minute ago, get it from the cache.
  • If it was added to the cache longer than 1 minute ago, get it in the regular way (from a database or calculate it) and replace it in the cache.

Choose one valid answer.

  1. maximumSize(100)
  2. maximumWeight(1)
  3. initialCapacity(1)
  4. expireAfterAccess(1, TimeUnit.MINUTES)
  5. expireAfterWrite(1, TimeUnit.MINUTES

For the correct answer scroll down

.

.

 

 

 

 

 

 

 

 

 

 

Do not miss valuable content. You will receive a monthly summary email. You can unsubscribe anytime.

 

 

 

 

 

 

 

 

 

 

 

 

 

.

.

.

The correct answer is: e. If you would like to read more, check Cache in Spring Boot 3 application article.