Using caches with Laravel Vapor.
cache
CLI command. When using the CLI command, the command will prompt you for more details about the cache such as its desired performance class:
cache
key to the environment’s configuration in your vapor.yml
file. The value of this key should be the name of the cache. When the environment is deployed, Vapor will automatically inject the necessary Laravel environment variables for connecting to the cache, allowing your application to start using it immediately:
cache:tunnel
CLI command. Jumpboxes are small, SSH-accessible servers placed within your private network.
After creating a jumpbox in your cache’s network, you can use the cache:tunnel
command:
localhost:6378
, allowing you to access it with the Redis management tool of your choice, such as Medis.
cache:scale
CLI command. When scaling a cache, you will be prompted to specify the number of “nodes” you wish to scale up or down to. When scaling a cache via the CLI, you should specify your desired number of nodes when executing the cache:scale
command.
Think of each node as a cache server with the performance specs you specified when the cache was created. Cache keys will automatically be sharded across all of your available nodes. Scaling a cache should not typically cause downtime:
cache:metrics
CLI command:
dynamodb
cache driver. All you need to do is start using it within your Laravel application!
If no Redis cache is attached to the environment, the DynamoDB cache will automatically be set as the default cache driver. These caches, while not as performant as Redis clusters, provide a very low-cost alternative for applications with light caching requirements.
cache:delete
CLI command: