I'm not sure about configuration of roles in Autchcache module, specifically with authenticated user role. I want to enable caching for both anonymous and authenticated users, but I want to exclude from caching some roles (administrator and webmanager). My web has a lot of roles but an authenticated user may has one, two or more of them.
For example, my web has the next roles: anonymous, authenticated, administrator, webmanager, rol1, rol2, rol3, etc. Some users may have some roles: rol3 and rol4, but other users may have only rol1 and rol2, etc. I want cahing for all of them except the ones who has webmanager or administrator.
How should I config this behavior in Authcache module?
1 Answer
Authcache will only attempt to cache a page and deliver a cached page respectively if every single role of the logged in user is authcache enabled.
Consider the following example:
- Five roles are defined on the website (including the built-in ones): anonymous, authenticated, customer role 1, customer role 2, administrator.
- Three roles are enabled for authcache: anonymous, authenticated, customer role 1
- User Customer A has the following role: customer role 1
- User Customer B has the following role: customer role 2
- User Customer C has the following roles: customer role 1 and customer role 2
- User Customer D has no additional roles
- User Administrator has the following role: administrator
This will lead to the following behavior:
- Authcache will kick in for every anonymous user (anonymous role is authcache enabled).
- Authcache will kick in for Customer A (customer role 1 is authcache enabled).
- Authcache will not kick in for Customer B (customer role 2 is not authcache enabled).
- Authcache will not kick in for Customer C (customer role 2 is not authcache enabled).
- Authcache will kick in for Customer D (authenticated is enabled)
- Authcache will not kick in for Administrator (administrator role is not authcache enabled).
-
Thanks for your explanation. Now, I understand it. It's a pity, because the way it works isn't good for my requirements and then I can't enable authcache for authenticated users because the most of my users are in your case C. In any case, thank for your help.– briastApr 10, 2019 at 6:30