Getting a lot of 'Could not unserialize response, returning uncached response instead.' #439
chrispage1
started this conversation in
General
Replies: 1 comment
-
This happens when the response has been cached, but is cleared or expired between calling You can add the following code to Laravel's exception handler to suppress those errors. $this->reportable(function (Exception $exception) {
/**
* laravel-responsecache correctly handles a race condition when the cached response is cleared or expired
* between calling 'hasBeenCached' and 'getCachedResponseFor'. However, it still does report when this happens.
* Because everything continues to work in this situation, and there is no bug, we are ignoring this message.
*
* See https://github.com/spatie/laravel-responsecache/pull/434.
*/
if ($exception->getMessage() === 'Could not unserialize response, returning uncached response instead. Error: Could not unserialize serialized response ``') {
return false;
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm getting a lot of errors throwing up 'Could not unserialize response, returning uncached response instead.'. While I don't think this is necessarily an issue, I'd be keen to know the reason why I might be getting this?
Thanks,
Chris.
Beta Was this translation helpful? Give feedback.
All reactions