Replies: 1 comment
-
Yes, replace a $user->id with your property which contains the required user ID.
As for me, IDK why, but ResponseCache::forget doesn't clear the cache for all users as required for us. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to clear the cache only for one user.
Example:
Each user has it's own list of items which can edit (add or remove element). Taking this actions will not be often, maybe once a few months so I would like to cache the response for some time. Now, when the user will add or remove new item, I would like to clear the cache so the user could get the newest changes right after.
The documentation says that "Logged in users will each have their own separate cache" and as far as I understand
ResponseCache::clear();
method clear all the cache, for all users at once.
Is there any way to clear cache only for currently logged in user?
Beta Was this translation helpful? Give feedback.
All reactions