DEV Community

Cover image for Cache Conundrum: A Daily Dialogue in the World of Code and QA
Jagroop Singh
Jagroop Singh

Posted on

Cache Conundrum: A Daily Dialogue in the World of Code and QA

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 or Ctrl + 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! πŸš€βœ¨

Top comments (6)

john12 profile image

@jagroop2001 !!
you are just me.......
I have to have the above mentioned conversation with my QA team and after that it's automatically solved.

I don't know why they have to ask even they know it's cache issue. They didn't even think that previously it was cache issue then now it may be cache issue.
But still everyday we have to convey them that " IT'S CACHE ISSUE"

jagroop2001 profile image
Jagroop Singh

Start putting this mandatory line in your JIRA ticket or any other Project management tool you use :

syeo66 profile image
Red Ochsenbein (he/him)

I had the following conversion once (not word for word).

QA: it does not work
Me: did you clear the caches?
QA: oh. No. Now it works, can we please remove caches for testing environments.
Me: Eh, maybe
QA: We need it
Me: Well then, okay

Days later...

QA: The system is too slow...


jagroop2001 profile image
Jagroop Singh

Soo true !!
But they have no other choice . They have to remove cache in order to test new feature.

works profile image
Web • Edited

@jagroop2001 !!
I completely understand what you write in the post.
Sometimes I feel, my co workers are too dumb or they just behave like that.

jagroop2001 profile image
Jagroop Singh

Everyone is smart!!
Some people specialise in appearing dumb while covertly acting brilliant.