Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh
Category:

in this tuto, I'll show you the methods for clearing or rebuilding Drupal 8 cache programmatically  and using admin UI, update.php, drush, SQL, ...

Programmatically using PHP

juste use this method where you want to clear the cache:

drupal_flush_all_caches();

there is also other methods to clear caches using:

By Admin UI

Navigate to /admin/config/development/performance and ​click the button "Clear all caches".

By Drush

drush cache-rebuild
//or you can use 
drush cr

By update.php

Run update.php (/update.php) is another way of clearing the cache.

By SQL

Delete all data inside  tables that start with "cache_" like this:
TRUNCATE cache_config;
TRUNCATE cache_container;
TRUNCATE cache_data;
TRUNCATE cache_default;
TRUNCATE cache_discovery;
TRUNCATE cache_dynamic_page_cache;
TRUNCATE cache_entity;
TRUNCATE cache_menu;
TRUNCATE cache_render;
TRUNCATE cache_toolbar;

 

 

Comments

Add new comment

Restricted HTML

Search

Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.

 

Contact Us

All the content is FREE but I still need your help

 

Become a patreon