You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a get request that returned a status of 503 and that result was being cached.
When I debugged into the code i could see that in cache-encoder.js it was only looking for statusCodes !== 500 to determine whether the result was cacheable:
Ah. Well, I think that's reasonably debatable... and I'm guessing we'd end up arguing forever about each status code and whether it is or isn't a correct to cache a given response under scenario X. :)
So... I guess I should probably add a setting or a callback so that users can choose the right thing to do in each case for their own circumstances.
No problem Scott ... status codes are in the api of the beholder :)
I can see your point, for what I am doing, I would never want to cache anything but success (200 - 299). But, that said, I probably would want it even more restrictive than most an only cache 200.
When the problem happened for me I got a 503 (Service Unavailable) and unfortunately, it stayed in the cache even after the service came back.
In any case, I would definitely agree with you that a setting or callback would make a lot more sense.
I had a get request that returned a status of 503 and that result was being cached.
When I debugged into the code i could see that in cache-encoder.js it was only looking for statusCodes !== 500 to determine whether the result was cacheable:
I would think that it should only cache statuses between >= 200 and < 300.
The text was updated successfully, but these errors were encountered: