Skip to content

Update README.MD (Laravel example)#1

Open
EdgarSedov wants to merge 1 commit intomasterfrom
EdgarSedov-patch-1
Open

Update README.MD (Laravel example)#1
EdgarSedov wants to merge 1 commit intomasterfrom
EdgarSedov-patch-1

Conversation

@EdgarSedov
Copy link
Owner

Old example for laravel leads to out of memory php fatal errors - because it doesn't limit the number of stored items and at the same time doesn't have ttl, so cache is remembered forever.
More than that, thanks to use of array_merge that leads to x2 memory usage (actually x3 because of inner Cache::put realization). So if your cache will have so much data what it weights about 100mb, php will require 300mb of memory during execution of old push method

image

Old example for laravel leads to out of memory php fatal errors - because it doesn't limit the number of stored items and at the same time doesn't have ttl, so cache is remembered forever.
More than that, thanks to use of array_merge that leads to x2 memory usage (actually x3 because of inner Cache::put realization). So if your cache will have so much data what it weights about 100mb, php will require 300mb of memory during execution of old push method
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.

1 participant