How To Clear Cache In Shared Hosting Server

How to clear the cache using a link?

How to clear the cache in a shared hosting server?

It happens a lot when you are developing applications and the functions do not work. Most of the time it is because of cache as we do in web browsers. Similar way you do in the project.

Clear cache CMD

Using CMD it is simple to call.

Clear cache:

php artisan cache:clear

Clear route cache:

php artisan route:cache

Clear view cache:

php artisan view:clear

Clear config cache:

php artisan config:cache

Do this to make all:

php artisan optimize:clear

The same in the shared hosting with a link

Clear cache:

Route::get('/clear-cache', function() {
     $cache = Artisan::call('cache:clear');
     return 'CAche facade value cleared';
});

Related Posts