DEV Community

Valentina Peric
Valentina Peric

Posted on

Working With Cache

Whether you are new to programming or you have been at it for a couple of years, you will run into cache. Maybe you have deployed updated code to a project that you have been working on and noticed that the changes are not there. You refresh the page and still nothing! You check deployment and everything looks good. Why are the changes not showing up? The answer probably is that the cache has not cleared.
 
So, what is cache? How do you work with it?
 
Cache is something that the browser will access quickly so it does not have to make a request to the server to see the contents of the page you are trying to access.
 
Picture this: you want to bake cookies. Instead of going to the store to retrieve flour, sugar, chocolate chips, etc. you go right to your kitchen and grab the ingredients you need. Instead of making the request to the server (i.e. going to the store to retrieve items), you accessed cache (i.e kitchen) to get your items in a much faster time.
 
Cache enhances user experience so you do not have to sit and wait for a page to load. In other words, you do not have to go the store every single time you want to bake cookies.
 
Back to the beginning of the article: Always. Remember. To. Clear. Cache! 😄

Top comments (0)