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?

  • 4
    On all projects I have worked so far there was always a custom route with a button to do that due to "administer site configuration" is just too powerful to give to editor or any non-superadmin role.
    – user21641
    Apr 17, 2017 at 19:44
  • 1
    Agreed that "admin site config" is too powerful of a permission. Have you seen any discussion on why clearing cache isn't broken out to it's own permission?
    – codesmith
    Apr 17, 2017 at 20:39

2 Answers 2


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:


Drupal flush cache permission module


To access this, they would need the administer site configuration permission.

From system.routing.yml:

  path: '/admin/config/development/performance'
    _form: 'Drupal\system\Form\PerformanceForm'
    _title: 'Performance'
    _permission: 'administer site configuration'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.