RUVIDEO
Поделитесь видео 🙏

Spring Boot @EnableCaching : 2018 | @Cacheable | @CachePut | @CacheEvict | @Caching смотреть онлайн

📁 Обучение 👁️ 16 📅 18.11.2023

In this video we will learn how to implement caching for Spring Boot

Lets see what is Spring Cache?
Spring cache is an abstract framework where Spring only provides the layer where other
third party caching implementations can be plugged in for storing data.
Hence, Spring does not provide any cache storage implementations where as it facilitates or allows to use caching mechanisms of user's choice.

When should we use cache?
Caching is supported for the methods. It's efficient to to use when the methods return the same result for the given input for the multiple invocations.

What does Spring provide us?
Spring provides a concept called Cache Abstraction. The idea is to provide a set of annotations to manage the caches.
So, to achieve cache abstraction we apply caching to Java methods, reducing the number of invocations.

What happens?
So, When a method with caching behavior is being invoked it checks whether the method has been already executed for the given arguments.
if true, the cached result is returned without executing the method
if false, the method is executed, result is stored so that from now on whenever this method is executed, the cache result is returned.

Hence, we restrict method invokation if the input is the same and check if the method is already being invoked

Spring Cache annotations :

@EnableCaching annotation is used to convey the framework that we are using Cache Abstraction feature for this project.

1.@Cacheable :if multiple requests are received by the application, then this annotation will not execute the method multiple times, instead it will send the result from the cached storage.

2.@CachePut: Update a cache entry

3.@CacheEvict:used for removing a single cache or clearing the entire cache from the cache storage.
If you set the allEntries=true, then, the entire cache will be cleared.

4.@Caching :allows multiple nested @Cacheable, @CachePut and @CacheEvict to be used on the same method

5.@CacheConfig: we annotate @CacheConfig at the class level to avoid repeated mentioning in each method.
If you have multiple operations in a class where each operation has to be given cache configuration details, this could be a tedious job.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Spring Boot @EnableCaching : 2018 | @Cacheable | @CachePut | @CacheEvict | @Caching» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.