Skip to content

sitegeist/Sitegeist.TreasureMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sitegeist.TreasureMap

Switch between multiple cache backendConfigurations based on a backendDiscriminator configuration.

This allows switching between cache configurations based on environment variables which enables things like green/blue caches to control cache invalidation during rollouts of larger applications.

Authors & Sponsors

The development and the public-releases of this package is generously sponsored by our employer http://www.sitegeist.de.

Configuration

The 'Sitegeist\TreasureMap\Backend\SwitchableBackend' cache backend is configured by the backendDiscriminator and the backendConfigurations the discriminator value will define which of the backend backendConfigurations will be used to instantiate the actually used backend.

Caches.yaml:

Neos_Fusion_Content: 
  backend: 'Sitegeist\TreasureMap\Backend\SwitchableBackend'
  backendOptions:
    backendDiscriminator: '%env:GREEN_OR_BLUE%'
    backendConfigurations:
      green:
        backend: 'Neos\Cache\Backend\RedisBackend'
        backendOptions:
          hostname: '%env:REDIS_HOST%'
          port: '%env:REDIS_PORT%'
          database: 11
      blue:
        backend: 'Neos\Cache\Backend\RedisBackend'
        backendOptions:
          hostname: '%env:REDIS_HOST%'
          port: '%env:REDIS_PORT%'
          database: 21 

Installation

Sitegeist.TreasureMap is available via packagist run composer require sitegeist/treasuremap to install.

We use semantic-versioning so every breaking change will increase the major-version number.

Contribution

We will gladly accept contributions. Please send us pull requests.

License

See LICENSE

About

Switch between multiple cache-backend via environment configuration.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages