- Issue created by @Timmy_Cos
- 🇭🇷Croatia Aporie
Hello,
Can you share more details on your issue, maybe screenshots?
The middleware is needed because you need to invalidate the alert block cache for each logged-in user and eventually each anonymous users (so on each request).
So basically this block can't be cached.
Thanks aporie,
Ahh yup that makes sense. Luckily in my case I don't need the alerts to vary by user so I think what I've got will work. Unfortunately I can't provide much more info, I can't figure out why the middleware causes problems for my site and haven't had time to try reproduce on a clean install.
I mostly just wanted to record the issue in case others have the same problem. If so it could possibly be resolved by setting a user context on the block, e.g. as in https://drupal.stackexchange.com/questions/288881/problem-setting-user-s....
- 🇭🇷Croatia Aporie
Yeah ... A user context will only cover logged-in users, unfortunately.
That's why we need this stack middleware, to cover anonymous users.
I'm keeping this ticket open for reference.