In the last couple of videos I've mentioned that there is a little problem with our application.
And so in this video and it tell you exactly what that problem is and then will start to take a look
at two different ways of solving that problem.
All right so I'm going to open up my chrome Council right here.
I'm going to find the network request tab and then I'm going to make sure that I'm filtering by x h
our requests.
Once I have that all selected and then going to it refreshed the page and we're going to take a look
at the request that are being issued by our application.
All right.
So take a look at this at the very top.
We've got our request to the post and point.
And then after that we've got a request to get users slash 1.
That means that we're getting the user ID number one and then the next request is also user with ID
1.
And then also user ID 1 and so on we are making request for user ID number one 10 times in a row and
then we are doing the same thing with user ID number 2 and 3 and 4 and so on.
In total we are making a hundred separate requests to fetch just 10 individual users.
So what's going wrong here.
Well remember we are showing one instance of the user Hetter component for every single blog post that
we fetch every time that a user header is rendered on the screen component amount is called in and so
we call this action creator fecche user with this particular user ID.
So essentially because we are rendering out a hundred instances of user Hetter our action creator gets
called a hundred different times.
Even though we are fetching some very very repetitive data.
So thats the issue we are fetching these users 10 times more often or frequently than we actually have
to.
Ideally we would only fetch each one of these user users exactly one time.
So we are going to have to figure out some way to make sure that we dont make all these duplicate requests
for each individual user.
So thats the big challenge and that's what's wrong with our application right now.
Now like I mentioned we're going to take a look at two different ways of solving this problem.
Now there's kind of a I don't know kind of easy way and kind of the easy way I would not necessarily
say that one method is significantly easier than the other.
One way is just a tiny little code change that we're going to make but it involves some really crazy
syntax.
The other way is a much more complicated change but it's also much easier to understand what is going
on and also take a pause right here.
When we come back the next section we're going to try solving this problem using the quick code change
that is kind of challenging to understand the syntax I'm making way too much of this list is take a
pause like the change in the next video.
So see you in just a minute.