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

diffiniate empty cache entry and non-existing cache entry #176

Open
onlinebizsoft opened this issue Jun 16, 2023 · 6 comments
Open

diffiniate empty cache entry and non-existing cache entry #176

onlinebizsoft opened this issue Jun 16, 2023 · 6 comments

Comments

@onlinebizsoft
Copy link

image

if ($data === null || $data === false || is_object($data)) {

Look like if we save a cache entry with empty content then when we load, it is treated as non-existing cache entry so this makes some wrong logic in application usages. It would be considered as a bug or we can't do anything in this case? @colinmollenhour

@colinmollenhour
Copy link
Owner

So if you save an empty string you get false? Seems that could be an issue with save then rather than load?

@onlinebizsoft
Copy link
Author

@colinmollenhour no, saving return true as expected. It should be an issue with load

@colinmollenhour
Copy link
Owner

I did not state my question well.. I meant, if you save an empty string and then load that key, you get false?

Please provide steps to produce, expected result and actual result for clarity.

@onlinebizsoft
Copy link
Author

Yes, exactly, this is used and tested in a context of Magento 2 project.

@colinmollenhour
Copy link
Owner

My system is messed up at the moment.. as a workaround you could use the test() method to check for existence of a key regardless of if it was empty or not.

@onlinebizsoft
Copy link
Author

Thanks, currently I can avoid using empty block or empty cache on the project. I just wanted to report the bug because in some cases, it can cause performance or other issues.

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

No branches or pull requests

2 participants