# Upgrading to Laminas-cache v3

**URL:** <https://discourse.laminas.dev/t/upgrading-to-laminas-cache-v3/2723>\
**Category:** Components & MVC\
**Tags:** laminas-cache\
**Created:** [January 18, 2022, 11:18am UTC](https://discourse.laminas.dev/t/upgrading-to-laminas-cache-v3/2723 "2022-01-18T11:18:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [October 5, 2022, 7:19pm UTC](https://discourse.laminas.dev/t/upgrading-to-laminas-cache-v3/2723/5 "2022-10-05T19:19:30Z")

</div>

> [@tasmaniski](#):
>
> I check the migration doc [Migration to Version 3.0 - laminas-cache - Laminas Docs](https://docs.laminas.dev/laminas-cache/v3/migration/to-version-3/)  
> but there is nothing about changed config in Laminas MVC configuration.

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

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

```

```php
return [
    'caches' => [
        'cache-example' => [
            'adapter' => 'apcu',
            'options' => ['ttl' => 3600],
            'plugins' => [
                [
                    'name' => 'exception_handler',
                    'options' => [
                        'throw_exceptions' => false,
                    ],
                ],
            ],
        ],
    ],
];

```

See also:

> [@I am new to Laminas, I need to know how Cache works](https://discourse.laminas.dev/t/i-am-new-to-laminas-i-need-to-know-how-cache-works/2925/8):
>
> Follow these steps for a laminas-mvc based application: Install laminas-cache and a storage adapter, like laminas-cache-storage-adapter-filesystem (if you use the laminas-mvc-skeleton application then both components are automatically registered in the application in config/modules.config.php) Extend the configuration of your application. You can use the global application configuration, e.g. the config/autoload/global.php file and choose a name for the cache: return [ 'caches' =\> […

---

_[View the full topic](https://discourse.laminas.dev/t/upgrading-to-laminas-cache-v3/2723)._
