I'm setting up an "editor" role for a D8 site. I noticed there's no "Flush all caches" in the Tools menu. I don't see any permission setting related to caches. How to enable cache clearing/cache rebuilding for non-admins?
To access this, they would need the
administer site configuration permission.
system.performance_settings: path: '/admin/config/development/performance' defaults: _form: 'Drupal\system\Form\PerformanceForm' _title: 'Performance' requirements: _permission: 'administer site configuration'
I'd like to mind the following answer to a similar feature request on DO:
I kind of disagree with this because of the that shouldn't be necessary in the first place. With cache tags, any change that an editor can make should automatically invalidate all relevant caches. Anything else is a bug IMHO.
Nevertheless in real world sometimes it may be necessary to have other roles than the one with
administer site configuration being able to rebuild caches.
Basically all you need to do is to build a trigger of some kind (button, route etc.) and let it fire
drupal_flush_all_caches(). Have a look at the Devel module for a great example of this approach.
Since I was in need of this myself – which was why I came here in the first place – I finally built a small module and published it on DO. It adds its own permission and places a button on the admin toolbar from which every user with the new permission is now able to flush all caches: