-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching for specific user roles #42
Comments
You can use the option "No cache generation by logged in users" for that. If you need more control there is already a hook for that: Here is an example: |
The option "No cache generation by logged in users" is for all users, so not what I suggested. I'll have a look at cachify_skip_cache but it would be a nice feature to add in a future version at the configuration page. |
Thanks for your input @Geschan! So basically you suggest turning the "No cache generation by logged in users" checkbox into an option where you could say e.g. "Only enable caching for users with role author or higher" . Does that sound about right? |
Basically yes. |
If we enable cache generation for user roles with an active admin bar this would be a problem. Even if we check is_admin_bar_showing there could be Edit links inside the theme which shouldn't be cached. |
Yeah enabling caching for logged-in users would mean not showing the toolbar or any Edit links to them as if they were normal visitors. To improve performance for logged-in users, we should think about integrating #31. Simply put, an object cache is a a key-memory store which gets populated so WordPress doesn't have to call the database dozens of times. |
There might be a problem with caching of regular users, but I'm rather talking of WooCommerce customers and similar with no rights to change any content on the site at all (except of writing comments). |
It would be useful if the cache can be enabled/disabled for specific user groups.
For example in a WooCommerce shop: cache enabled for customers (as cart, checkout and my-account aren't cached anyways), cache disabled for admins and all other roles (especially roles with activated admin-bar).
The text was updated successfully, but these errors were encountered: