Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to keep caching up to date

when memecached or Redis is used for data-storage caching. How is the cache being updated when the value changed?

For, example. If I read key1 from cache the first time and it missed, then I pull value1 and put key1=value1 into cache.

After that if the value of key1 changed to value2. How is value in cache updated or invalidated?

Does that mean whenever there is a change on key1's value. Either the application or database need to check if this key1 is in cache and update it?

like image 452
user1947415 Avatar asked Jul 29 '17 03:07

user1947415


People also ask

What are the best ways to keep up to date?

Blogs are an awesome way to keep up to date because, of course, they’re always updating themselves. Magazines, podcasts, screencasts, and other regularly updated publications are great to follow as well. Many of us get the majority of our information from these sources, and for good reason. It’s easy to find both instant and quality material.

How to stay up to date in a niche?

It’s not possible to know everything, but it is possible to stay up to date in a niche. That’s what we as web designers and developers must do: focus on a specialty, and consistently learn more about it. In this article, we’ll discuss some tips for staying up to date, and keeping inspired in our fields. 1. Teach Others

How can I help my team stay up-to-date?

Don't just have one team update something new without thoroughly communicating your initiatives to your entire business. Encourage them to adjust and adapt to your business and communicate how important it is to stay up to date on technology trends, too. Make sure you make time to review your learnings before you implement your newfound knowledge.

Is it correct to say keep up to date with?

You can use “keep up to date with” and “keep up to date on” synonymously, but it’s best to use them informally. “With” works best when referring to a source of information (like the news) or a task (like housework). “On” works best when referring to a topic (like politics).


1 Answers

You can simply empty the particular cache value in the api function where insertion or updation of that particular value is performed. This way the server will fetch the updated value in the next request because you had already emptied the cache value.

Here is a diagram which will make it easier for you to understand: Redis Caching Architecture diagram

like image 52
satyam_naithani Avatar answered Oct 01 '22 01:10

satyam_naithani