Imagine a scenario where a Single Page Application (SPA) built using angular or vuejs loads 3 components on a page, with each component making requests to different backend APIs.
Now, if a user decides to refresh the page, those same 3 API calls are triggered again. However, this time the backend responds with a 304 status code for each request.
Since SPA components are essentially just JavaScript code, they expect data to be returned from the backend with every call. But when a 304 status code is received, it means there's no new data. Surprisingly, everything seems to work fine...
It appears like there's some sort of magic happening behind the scenes that I can't quite grasp. Could someone shed light on this mystery for me?