Cache Conundrum: A Daily Dialogue in the World of Code and QA
Jagroop Singh
Posted on January 20, 2024
I recently wrote π a post on LinkedIn where I discussed the everyday conversation that I have in my office πΌ with the QA team,some engineers, and project managers.π€π
Here is my linkedIn Profile.
From that post π, I had an idea π‘ to create a blog about it so that they might grasp what developers π₯οΈ view as cache.
So let's get started with that:
A cache is a hardware or software component placed in the memory of an application or device that automatically and temporarily saves data consumed by the user in order to reduce the time and effort required to retrieve data the next time the programme or device is used.
Oh..., there are a lot of technical jargon π€―. Don't worry, let's explain this through the narrative of Prince Kim and Princess Rose. π€΄πΉβ¨
Prince Kim π€΄ from the kingdom of Utopia likes Princess Rose, whom he met at their kingdom's Party. He wanted to marry her after that, but she refused.
So Prince Kim assigned his best friend Jin to deliver his letters ππ to her.Every day, Jin goes to Rose's kingdom and transfers the letter ππ to her, receiving a reaction of 'NO' β and relaying this message to Prince Kim.
Jin must travel to Princess Rose's kingdom on a daily basis to receive her response, which is 'NO' β, as expected. So Jin discovers the pattern in which she consistently says 'NO' β. So rather than going to Rose's kingdom, which is extremely far away, he assumes from her prior response and says 'NO' β to prince.
That's what caches do. Jin acts as a cache, storing Rose's prior responses in his memory, reducing the need for effort to obtain a response from herπΉβ¨.
However, it is likely that she changed her mind in the span of time, but owing to the cache, the true reaction of Princess Rose was never revealed to Price Kim.
There are additional sorts of caches, however I will discuss the one that QA and developers typically encounter during testing or development:
- Browser Side Cache
- Server Side Cache
Browser Side Cache:
A browser cache is a temporary storage space on your computer or device that keeps copies of web pages and associated files (such as pictures, scripts, and stylesheets) that are frequently requested by web servers.
Why it's important:
This is significant since some files, graphics, and code never change, and it is costly to request the server even while the content remains constant. If it is not available, it will send unnecessary requests to the server, andΒ consuming resources.
Why it's problem at the same time :
I'll illustrate this with an example. For example, in some e-commerce websites, if the image of the product with the price is cached, and the price or image changes in the future, it may deduct more money and produce a different product than planned, causing an issue for that user even it is not.
To whom this happened :
- Those that use that website constantly without taking a break (usually testers do, hence they encounter this difficulty the most)
How to get rid of this:
- Always remove cache, cookie,localstorage,sessionstorage etc . before using.
- Pressing
Ctrl+f5
orCtrl + Shift + R
- Using Cache clear browser extension.
Server Side Cache:
Server-side caching is a strategy for improving the performance and efficiency of online applications that involves storing frequently requested data or computed results on the server. This lets the server to serve subsequent requests for the same data more rapidly by retrieving the cached information rather than recomputing or downloading it again.
Why it's important :
Server-side caching is essential for web applications because it increases speed by lowering response times and server load, resulting in a more scalable and responsive user experience.
Why it's problem at the same time :
It's not a problem as without that it's very difficult to provide fast results.
To whom this happened :
- To everyone (tester's , real user's etc.) because Server is serving cached response instead of updated response.
How to get rid of this:
We have the option of clearing the cache, and it varies depending on the server provider.
Thatβs all in this blog.π Cheers to the adventure that awaits and the stories yet to unfold! πβ¨
Posted on January 20, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.