Laravel provides an expressive, unified API for various caching backends. We stored all Cache information in the config/cache.php file of your project. They configure Laravel to use a file cache driver to keep the serialized cached objects in the filesystem.
Driver Prerequisites:-
Database:
You are going with a database cache driver. You will need to create a table that contains cache items.
Schema::create('cache', function ($table) { $table->string('key')->unique(); $table->text('value'); $table->integer('expiration'); });
Run the artisan command php artisan cache:table. It will generate a migration with the proper schema.
Memcached:
For Memcached driver requires Memcached PECL package. You may list all the Memcached servers in the config/cache.php file.
'memcached' => [ [ 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100 ], ],
Top comments (0)