megacolorboy

Back

Published on March 12th, 2021

Laravel

Clearing cache on a Shared Hosting Server

Hosted your website on a Shared Hosting Server and got limited access to clear the cache on your project?Open up and create this route:Just type the URL and it will clear all existing cache from the project.Hope this helps you out!

1 minute read

Hosted your website on a Shared Hosting Server and got limited access to clear the cache on your project?

Open up routes/web.php and create this route:


<?php
Route::get('/clearcache', function(){
    \Artisan::run('config:clear');
    \Artisan::run('cache:clear');
    \Artisan::run('view:clear');
    \Artisan::run('route:clear');
    \Artisan::run('config:cache');
});
?>

Just type the URL and it will clear all existing cache from the project.

Hope this helps you out!