Changing cache array driver to default serialize to true #45215
hdimitrov1
started this conversation in
Polls
Replies: 2 comments 1 reply
-
I am not using the array driver only for testing. I also use it currently in a crawler for queues that don't need storage at all as it is crawled |
Beta Was this translation helpful? Give feedback.
0 replies
-
Makes sense, if this is a common use case maybe it's valid to not change it to a new default. Obviously, can always opt out of this behaviour if it clashes with your system |
Beta Was this translation helpful? Give feedback.
1 reply
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Currently, if you put an object into the array cache driver, it will update as time goes on. Considering the array driver is only really used for testing, it behaving different to all other drivers feels undesirable.
Example
On the array driver, this prints barbar. on any other driver, this prints bar.
This behaviour is toggleable, by changing the serialize config of the driver. It currently defaults to false (behaviour described above). Setting it to true would make behaviour more consistent.
IMO, this defaulting to true in the next major release makes sense, as the array driver is supposed to be testing only, having your tests behave differently from your prod driver, is an unnecessary footgun (i got caught out by this). If people don't want this (it does have potential to break tests, but can just opt out)
6 votes ·
Beta Was this translation helpful? Give feedback.
All reactions