By default, the partition key should be named key. This table should also have a string partition key with a name that corresponds to the value of the configuration item within your application's cache configuration file. However, you should name the table based on the value of the configuration value within your application's cache configuration file. Typically, this table should be named cache. In addition, official Laravel deployment platforms such as Laravel Forge and Laravel Vapor have the PhpRedis extension installed by default.įor more information on configuring Redis, consult its Laravel documentation page.īefore using the DynamoDB cache driver, you must create a DynamoDB table to store all of the cached data. Laravel Sail already includes this extension. You'll find an example Schema declaration for the table below:īefore using a Redis cache with Laravel, you will need to either install the PhpRedis PHP extension via PECL or install the predis/predis package (~1.0) via Composer. When using the database cache driver, you will need to setup a table to contain the cache items. You may even configure multiple cache configurations for the same driver. For larger applications, it is recommended that you use a more robust driver such as Memcached or Redis. By default, Laravel is configured to use the file cache driver, which stores the serialized, cached objects on the server's filesystem. The cache configuration file also contains various other options, which are documented within the file, so make sure to read over these options. In addition, a file based cache driver is available, while array and "null" cache drivers provide convenient cache backends for your automated tests. Laravel supports popular caching backends like Memcached, Redis, DynamoDB, and relational databases out of the box. In this file, you may specify which cache driver you would like to be used by default throughout your application. Your application's cache configuration file is located at config/cache.php. Thankfully, Laravel provides an expressive, unified API for various cache backends, allowing you to take advantage of their blazing fast data retrieval and speed up your web application. The cached data is usually stored in a very fast data store such as Memcached or Redis. When this is the case, it is common to cache the retrieved data for a time so it can be retrieved quickly on subsequent requests for the same data. Some of the data retrieval or processing tasks performed by your application could be CPU intensive or take several seconds to complete.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |