Laravel 5 Delete Cache in Shared Hosting Server

Laravel Delete Cache Files From Shared Hosting

Many times in Laravel websites we notice that new changes are not reflected on live site. This happens due to cache copies that are served it cache is available.

So to overcome this problem we have 2 methods to delete the existing pre-compiled cache files.

  1. Deleting Cache Using Terminal with Commands (CLI)
  2. Deleting Cache Using Artisan command outside CLI

Deleting Cache Using Terminal with Commands (CLI)

To delete laravel cache using this method we need SSH or Terminal access. Now open your terminal and navigate to your laravel website code and run below commands one by one:

Clear Application Cache

To delete your application cache files run below command:

Clear Route Files Cache

To delete your route cache files from a server run below command:

Clear View Files Cache

To delete your view cache files run below command:

Clear Config Cache

To delete your config cache run below command:

Many Shared Hosting providers don’t provide SSH access, so at that time you need to use another method Deleting Cache Using Artisan command outside CLI.

Deleting Cache Using Artisan command outside CLI

As I said if you don’t have terminal access then you can create a route to delete cache files from the server.

Or you can also create the below script to delete all in a single request:

Try and let me know if you find any problem in executing this.

Leave a Reply

Your email address will not be published. Required fields are marked *