New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symfony/adapter-bundle pool_namespace support? #79

Open
bendavies opened this Issue Oct 26, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@bendavies

Hey,

I'd like to use different namespaces for each of my caches, as the cache key can colide.
Example:

cache_adapter:
  providers:
    customer_foo_cache:
      factory: 'cache.factory.doctrine_filesystem'
      options:
       directory: '%kernel.cache_dir%/cache'
    customer_bar_cache:
      factory: 'cache.factory.doctrine_filesystem'
      options:
       directory: '%kernel.cache_dir%/cache'

If i am caching Foo and Bar values for my customer, i'd like to just use the customer's ID as the cache key, but ofcourse that won't work as it'll collide between caches.

Can we either add NamespacedCachePool support to all cache adapters, or alternatively, enable configuring the namespace option for doctine adapters? obviously the former is more desirable.

Let me know if i'm missing anything obvious.

Thanks

@bendavies

This comment has been minimized.

Show comment
Hide comment
@bendavies

bendavies Oct 26, 2016

I see that the adapters must support Hierarchy to support NamespacedCachePool. so that's that out of the question.

At the moment, my workaround is a different directory for each adapter.
Is there a nicer way?

I see that the adapters must support Hierarchy to support NamespacedCachePool. so that's that out of the question.

At the moment, my workaround is a different directory for each adapter.
Is there a nicer way?

@Nyholm

This comment has been minimized.

Show comment
Hide comment
@Nyholm

Nyholm Mar 28, 2017

Member

For your use case you may want to look at PrefixCache. But that would be an issue when you clearing cache: http://www.php-cache.com/en/latest/#prefix

Member

Nyholm commented Mar 28, 2017

For your use case you may want to look at PrefixCache. But that would be an issue when you clearing cache: http://www.php-cache.com/en/latest/#prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment