Closed rajashekhargithubb closed 2 months ago
@DuCanhGH Any insights??
For fuck's sake, have some patience, will ya? It was a bloody fucking state funeral over here.
Onto your question.
Workbox transforms your urlPattern
string to new URL(urlPattern, location.href)
. So avoid using that. Consider a RegExp or a function. Now, if you use a RegExp, it has to match the entire requesting URL. So basically just go and use a function.
@rajashekhargithubb I was a bit mad last week with your prompting me to answer you. It was not the best time for us Vietnamese over here. I'd like to express my sorry for that. I do request that you have some patience the next time you open an issue though.
Now, let's take a proper look at your issue. Are you sure that the actual requested URL is exactly "https://reqres.in/api/users?page=2"? If that's the case, the route should match. If not, do recheck if Tanstack Query inserted anything to the URL. I don't use the library, so there's not much I can tell you about that.
You may also want to use a urlPattern
function to check if the URL does actually match.
@DuCanhGH No Worries, I appreciate your response, I have fixed it using urlPattern with few logics.
Provide environment information
Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster
No Link
To reproduce
Follow Installation steps with having Tanstack Query to fetch API's
Describe the bug
Unable to cache API's through running through Tanstack Query, Tried with fetch API still the issue persists.
Tried the following ways but still no luck
Q: Do self origin needs to be the same to cache API response? if yes whats the solution to cache other origin responses?
Expected behavior
Expecting to cache API responses flawlessly
Screenshots (if relevant)
Additional information (if relevant)
No response