Hi Jordi (et al.), nice job!
Tbh I was a bit surprised as I haven't seen any discussion about it at all after the entrance vote and I wasn't aware of it being worked on anywhere outside this ML. My fault, as I've probably missed that communication and didn't check or ask around. That said, below are my major gripes with it, inherited from PSR-6. I understand where "MUST treat an item as expired once its Expiration Time is reached" comes from, and I would agree, but for a cache it makes little sense to be so strict and adamant about it. An entry that has a TTL of 30 seconds is probably going to be fine at 31s too, especially if expiration can't be expressed as a point in time. Relaxing that would allow implementations to conform to the PSR-6 interface and adding stampede protection the same way apc(u) / squid do, i.e. returning a slightly stale item while a single process is updating the cache. Not a deal-breaker, but "SHOULD treat an item as expired" can be implemented as "always treat..." if anyone so desires, whereas the opposite is not possible. Other than that, I also am not very fond of null meaning either never or some unspecified default value. A library would be forced to pick one as there's no way to set an item to never expire if a default is available. I personally like being able to specify a default TTL, but I would trade that in exchange for something cleaner and clearer. Alternatively, I'd suggest adding something like CacheInterface::setDefaultTTL() and CacheInterface::TTL_NEVER = -1, with support for the latter being subject to the actual storage capabilities. Cheers On 16/11/2016 15:22, Jordi Boggiano wrote: > Heya, > > We believe PSR-16, Simple Cache, is now ready for final review. As > coordinator, I hereby open the mandatory review period prior to a formal > acceptance vote; voting will begin no earlier than December 1st, 2016. > > Here are links to the most current version and its meta document: > > https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache.md > > > https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.md > > > > The package containing the interfaces is there: > > https://github.com/php-fig/simplecache > > > The latest important changes to the interfaces can be found at: > > https://github.com/php-fig/simplecache/releases/tag/0.2.0 > > > And FWIW, Scrapbook already provides a PSR-16 implementation in its > upcoming release: > https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php > > > > Thanks for your time reviewing! > > Cheers > -- Matteo Beccati Development & Consulting - http://www.beccati.com/ -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscr...@googlegroups.com. To post to this group, send email to php-fig@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/5ed473d6-0d38-6da9-4b0a-7fe1bcbe0641%40beccati.com. For more options, visit https://groups.google.com/d/optout.