Spring: Why do you have more than one cache

I go through Spring cache paragraph functions and this line caught my attention

Although in most cases only one cache is declared, the annotation allows for several names that must be specified in order for more than one cache to be set b.

The above line refers to this fragment, which follows the above instructions in the documentation.

@Cacheable({"books", "isbns"})
public Book findBook(ISBN isbn) {...}

Why do you need to have more than one cache for the same method? Wouldn't one cache suffice for every behavior (function) that needs to be cached? What would be the appropriate option for this?

+4
source share
1 answer

, / , , .

- , (, /), .

, .

+3

Source: https://habr.com/ru/post/1688310/


All Articles