phpro / annotated-cache Goto Github PK
View Code? Open in Web Editor NEWMakes it easy to configure the caching of your services with annotations.
License: MIT License
Makes it easy to configure the caching of your services with annotations.
License: MIT License
Phpro\AnnotatedCache\Interceptor\CacheableInterceptor::interceptSuffix returns Cache\Adapter\Common\CacheItem;
but Symfony\Component\Cache\Adapter interacts only with Symfony\Component\Cache\CacheItem otherwise will skip save to cache
@see Symfony\Component\Cache\Adapter\AbstractAdapter::save()
public function save(CacheItemInterface $item)
{
if (!$item instanceof CacheItem) {
return false;
}
$this->deferred[$item->getKey()] = $item;
return $this->commit();
}
Or there should be fix on Symfony side in this method?
Edit: Symfony is logging some debug info via static method CacheItem::log, thats missing in standardized Cache\Adapter\Common\CacheItem;
Edit2: I have created new SymfonyInterceptor
https://github.com/insekticid/phpro-annotated-cache-symfony-cache
Hi there,
Nice looking library. I want to give it try. But I'm new to all the PSR-6 cache handling. So maybe I just didnt understand something about that yet...
Lets say I have a service with 2 methods, each method is a getSomething($key), so I annotate them like this:
/**
* @Cacheable(pools="products")
*/
public function hasProduct($productCode)
{
...
}
/**
* @Cacheable(pools="products")
*/
public function getProductName($productCode)
{
....
}
I want to have all arguments as the key, so I omit the key="" attribute. Why is it that even if I use different pools for both methods that I end up having only one key written in my cache backend (which is redis). I thought that the method's name is taken into account when generating the key, or at least the pool's name...
I'm stuck :(
Your code looks awesome and its definitely a better implementation than the one from https://github.com/TheBigBrainsCompany/TbbcCacheBundle (which is also good)
Thanks for any hint
Markus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.