Skip to content
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

Psr16 adapter and useStaticItemCaching #922

Closed
1 task done
remcohn opened this issue Nov 14, 2024 · 1 comment
Closed
1 task done

Psr16 adapter and useStaticItemCaching #922

remcohn opened this issue Nov 14, 2024 · 1 comment
Assignees

Comments

@remcohn
Copy link

remcohn commented Nov 14, 2024

What type of issue is this?

Incorrect/unexpected/unexplainable behavior

Operating system + version

Debian 12

PHP version

8.3

Connector/Database version (if applicable)

Redis

Phpfastcache version

9.2.0 ✅

Describe the issue you're facing

If you use the Psr16 adaptor and get() and item in a loop, and it expires, the value is never refreshed.

Expected behavior

As indicated in the help for useStaticItemCaching : Can be used for cron script that loop indefinitely on cache items to avoid calling detachAllItems()/detachItem($item) from the cache pool.

But detach is not available in the Psr16 adapator. shouldnt then get() try to refresh the item?

Code sample (optional)

No response

Suggestion to fix the issue (optional)

No response

References (optional)

No response

Do you have anything more you want to share? (optional)

No response

Have you searched in our Wiki before posting ?

  • I have searched over the Wiki
@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2024

You can indeed passe the "useStaticItemCaching=false" option to the second argument of Psr16Adapter constructor, so you won't need to call detach* methods :)

@Geolim4 Geolim4 closed this as completed Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants