Upgrading to Laminas-cache v3

The configuration is identical for stand-alone use and in a laminas-mvc-based application:

// Via array configuration:
$cache = $storageFactory->createFromArrayConfiguration(
    [
        'adapter' => 'apcu',
        'options' => ['ttl' => 3600],
        'plugins' => [
            [
                'name'    => 'exception_handler',
                'options' => [
                    'throw_exceptions' => false,
                ],
            ],
        ],
    ]
);
return [
    'caches' => [
        'cache-example' => [
            'adapter' => 'apcu',
            'options' => ['ttl' => 3600],
            'plugins' => [
                [
                    'name'    => 'exception_handler',
                    'options' => [
                        'throw_exceptions' => false,
                    ],
                ],
            ],
        ],
    ],
];

See also: