I will try to add it to the meta document or maybe add more text to the
spec regarding this default expiration. I think that's the best way to
make people aware of it.
That said, the symfony cache I mentioned for example, is a PSR-6
implementation, and will most likely implement PSR-16, while letting you
have items that don't expire if you use NULL. You just don't get that
guarantee at the spec level, I see that.
Cheers
On 17/11/2016 21:21, Andrew Carter wrote:
I don't agree with the decision, but I understand the trade off.
What we're trading is the ability to set a default value in the cache
configuration at the cost of not having an interoperable way for
developers to create items which don't expire.
From what I can tell, the PSR-6 API that we are both replacing and
trying to maintain compatibility with (?) is the only cache that
operates in this manner. Most other caches operate with a NULL or 0 TTL
corresponding to an entry that doesn't have a natural expiry time: apc
<http://php.net/manual/en/function.apc-store.php>, memcache
<http://php.net/manual/en/memcached.expiration.php>, redis
<http://redis.io/commands/persist>, xcache
<https://xcache.lighttpd.net/wiki/XcacheIni>, doctrine
<http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/caching.html#saving>,
the symfony one you mentioned, etc..
This is my last post on the subject, but I'd like whoever calls the vote
to make sure that this decision and the existence of our discussion has
been made clear to the voting members. I'm not sure if there's any
requirement for the voting threads to draw attention to this - but I
think that would be a good precedent to set if not.
My last post on the subject as I think we understand each other, just
disagree on the outcome.
Cheers,
Andrew
On Thursday, November 17, 2016 at 7:09:15 PM UTC, Jordi Boggiano wrote:
I see what you mean, but down the line it doesn't actually matter as it
is merely a cache.
You can never rely on anything you store in there being there when you
want to read it again, no matter what expiration you set. The backend
might be full and wiping stuff early, etc. All you can do is *request*
that something be stored for a given amount of time.
Given that fact I think that the null as it is now is kinda ok, it lets
an application developer if they so wish configure their lib to make
all
cache entries expire after X hours by default, or they can say no
actually keep everything forever unless otherwise specified, or if you
have specific needs as a library author you can give specific
expiration
times. It adds a tiny bit of control for the app developer, and doesn't
really remove anything from lib developers as they can anyway not rely
on any guarantee from the cache.
Does this make sense to you?
Cheers,
Jordi
On 17/11/2016 18:43, Andrew Carter wrote:
> Not sure I fully understand that - as a user I can't rely on common
> sense implementations doing it right. If it's not part of the
standard,
> I can't guarantee it as a feature and I can't use it.
>
> My only course of action for using that feature would be tightly
> coupling to a cache library that did support items which don't
expire,
> and losing interoperability (as I have done in the past).
>
> On Wednesday, November 16, 2016 at 4:15:21 PM UTC, Jordi Boggiano
wrote:
>
> This was carried over from PSR-6 tbh, and my understanding is
that "an
> Implementing Library MAY use a configured default duration"
means you
> can very well treat null as "do not expire ever".
>
> If you read the symfony cache docs for example [1], it shows
that by
> default they treat it that way, and I'd expect others do that
too but I
> havent' researched in depth.
>
> As such I am ok leaving it as is because the common-sense
> implementations will do it right, and it doesn't warrant
breaking away
> from PSR-6 IMO.
>
> Cheers
>
> [1]
>
https://symfony.com/doc/current/components/cache/cache_items.html#cache-item-expiration
<https://symfony.com/doc/current/components/cache/cache_items.html#cache-item-expiration>
>
<https://symfony.com/doc/current/components/cache/cache_items.html#cache-item-expiration
<https://symfony.com/doc/current/components/cache/cache_items.html#cache-item-expiration>>
>
>
> On 16/11/2016 17:03, Andrew Carter wrote:
> > Good work.
> >
> > One thing that always bothered me from a user perspective
was not
> being
> > able to put an item in the cache that doesn't expire (different
> from a
> > default expiration time). Having to create times really far in
> advance
> > is messy, and you never know if you're going to run into
2038 bugs
> etc.
> > It's also quite common to have an entry that you don't want to
> expire,
> > because you'll invalidate it yourself or wait for the cache to
> drop it
> > when it's full.
> >
> > For me, saying that a NULL ttl means some default value
somewhere
> is a
> > waste of a feature. If I wanted a default value, my code can
(and
> > should) explicitly take care of that. I think documenting
NULL to
> mean
> > "This item doesn't expire. If the cache driver doesn't not
support
> items
> > that do not expire, the ttl will be set to the maximum
possible."
> >
> > Cheers,
> >
> > Andrew
> >
> > On Wednesday, November 16, 2016 at 2:22:20 PM UTC, 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.md>
>
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache.md
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache.md>>
>
> >
>
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache.md
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache.md>
>
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache.md
<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
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.md>
>
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.md
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.md>>
>
> >
>
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.md
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.md>
>
<https://github.com/php-fig/fig-standards/blob/1cf169c66747640c6bc7fb5097d84fbafcd00a0c/proposed/simplecache-meta.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
<https://github.com/php-fig/simplecache>
> <https://github.com/php-fig/simplecache
<https://github.com/php-fig/simplecache>>
> > <https://github.com/php-fig/simplecache
<https://github.com/php-fig/simplecache>
> <https://github.com/php-fig/simplecache
<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
<https://github.com/php-fig/simplecache/releases/tag/0.2.0>
> <https://github.com/php-fig/simplecache/releases/tag/0.2.0
<https://github.com/php-fig/simplecache/releases/tag/0.2.0>>
> >
<https://github.com/php-fig/simplecache/releases/tag/0.2.0
<https://github.com/php-fig/simplecache/releases/tag/0.2.0>
> <https://github.com/php-fig/simplecache/releases/tag/0.2.0
<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
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php>
>
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php>>
>
> >
>
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php>
>
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php
<https://github.com/matthiasmullie/scrapbook/blob/master/src/Psr16/SimpleCache.php>>>
>
> >
> >
> >
> > Thanks for your time reviewing!
> >
> > Cheers
> >
> > --
> > Jordi Boggiano
> > @seldaek - http://seld.be
> >
> > --
> > 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+u...@googlegroups.com <javascript:>
> > <mailto:php-fig+u...@googlegroups.com <javascript:>>.
> > To post to this group, send email to php...@googlegroups.com
> <javascript:>
> > <mailto:php...@googlegroups.com <javascript:>>.
> > To view this discussion on the web visit
> >
>
https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com>
>
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com>>
>
> >
>
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com?utm_medium=email&utm_source=footer
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com?utm_medium=email&utm_source=footer>
>
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com?utm_medium=email&utm_source=footer
<https://groups.google.com/d/msgid/php-fig/2dadde75-0559-4a64-a77d-e13bbe1e5690%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
>
> > For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>
> <https://groups.google.com/d/optout
<https://groups.google.com/d/optout>>.
>
>
> --
> Jordi Boggiano
> @seldaek - http://seld.be
>
> --
> 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+u...@googlegroups.com <javascript:>
> <mailto:php-fig+u...@googlegroups.com <javascript:>>.
> To post to this group, send email to php...@googlegroups.com
<javascript:>
> <mailto:php...@googlegroups.com <javascript:>>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/php-fig/21e8071e-c6a6-484d-9a70-56413b336a0a%40googlegroups.com
<https://groups.google.com/d/msgid/php-fig/21e8071e-c6a6-484d-9a70-56413b336a0a%40googlegroups.com>
>
<https://groups.google.com/d/msgid/php-fig/21e8071e-c6a6-484d-9a70-56413b336a0a%40googlegroups.com?utm_medium=email&utm_source=footer
<https://groups.google.com/d/msgid/php-fig/21e8071e-c6a6-484d-9a70-56413b336a0a%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
Jordi Boggiano
@seldaek - http://seld.be
--
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
<mailto:php-fig+unsubscr...@googlegroups.com>.
To post to this group, send email to php-fig@googlegroups.com
<mailto:php-fig@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/0c6b40bb-ae5a-4bd3-83f0-f617c8d0d4aa%40googlegroups.com
<https://groups.google.com/d/msgid/php-fig/0c6b40bb-ae5a-4bd3-83f0-f617c8d0d4aa%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
Jordi Boggiano
@seldaek - http://seld.be
--
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/e7ad073d-7335-07db-3b79-9a5e4b566523%40seld.be.
For more options, visit https://groups.google.com/d/optout.