Skip to content

[9.x] pass value along to ttl callback - #46006

Merged
taylorotwell merged 2 commits into
laravel:9.xfrom
dododedodonl:cache-remember-ttl
Feb 7, 2023
Merged

[9.x] pass value along to ttl callback#46006
taylorotwell merged 2 commits into
laravel:9.xfrom
dododedodonl:cache-remember-ttl

Conversation

@dododedodonl

Copy link
Copy Markdown
Contributor

When using the Cache::remember() method I sometimes have a value that contains data which determines when the value should expire.

When it is relatively costly to determine the value, the functionality of Cache::remember() has to be duplicated elsewhere in order to not determine it twice. Providing the value to the ttl callback via the already used value() function would eliminate this duplication.

@taylorotwell
taylorotwell merged commit 395f305 into laravel:9.x Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants