# /config/packages/bash_cache.yaml
bash_cache:
clients:
main:
$options:
prefix: sportal
expires:
short: 60
$parameters:
dsn: tcp://127.0.0.1
port: 6379
database: 0
timeout: 3
counter:
$options:
persistent: counters
prefix: sportal
expires:
long: 60
$parameters:
dsn: tcp://127.0.0.1
port: 6379
database: 1
timeout: 3
storage:
$options:
prefix: storage
expires:
long: 3600
$parameters:
dsn: tcp://127.0.0.1
port: 6379
database: 2
timeout: 3
# /config/service.yaml
Bash\Bundle\CacheBundle\BashRedis\Client $mainRedis: '[@bash_cache](https://github.com/bash_cache).main'
Bash\Bundle\CacheBundle\BashRedis\Client $counterRedis: '[@bash_cache](https://github.com/bash_cache).counter'
or
class IndexController extends AbstractController
{
/**
* [@Route](https://github.com/Route)("/",priority=100, methods="GET", name="homepage")
*/
public function __invoke(ContainerInterface $container): Response
{
dump($container->get('bash_cache.main'));
dump($container->get('bash_cache.counter'));
dump($container->get('bash_cache.storage'));
$number = rand(0, 100);
return new Response(
'<html><body>'.$number.'</body></html>'
);
}
}
How can I help you explore Laravel packages today?