Middleware being called without args #350
Unanswered
milosevicn
asked this question in
Q&A
Replies: 1 comment
-
This was my mistake. I have registered middleware twice, once globally and once for routes. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have used middleware as it is described in docs, to apply tags to certain routes:
and used
ray()
insidehandle()
function inSpatie\ResponseCache\Middlewares\CacheResponse.php
to dump$args
, third parameter in function. For some reason it's being triggered twice, but the problem is that first time it returns empty array and second time I am getting what I am supposed to get['0' => 'blog']
.This results in page being cached twice, once with and once without tag. So later, when I try to delete it from cache using
ResponseCache::clear(['blog'])
, only one is being deleted, and the other one stays in cache.Now, my question is, how is it possible that
CacheResponse
middleware is even being called without parameters, when I am passing some to it?Beta Was this translation helpful? Give feedback.
All reactions