When making queues, for example, when queuing for product orders, we use redis' list. I think we can use PHP's array_push and array_pop instead of redis' list?
过去多啦不再A梦2017-05-16 13:16:47
An array cannot exist between multiple requests. When a single request ends, the process ends, resources are released, and the array is destroyed. Data persistence is required
漂亮男人2017-05-16 13:16:47
Obviously not. If you can play like this, there will be no need to cache anything
我想大声告诉你2017-05-16 13:16:47
php is a process, it will not exist the next time after one request. Unless you store this array in the database
漂亮男人2017-05-16 13:16:47
Yes, but you need to use cache to save the status of pushing and popping the stack, because the data of a single user process will not be shared with other users. You need to save it every time it changes. If you don’t need to save it with redis, then use file cache every time. All changes must be saved