For example, the data is shared data (such as site information ). A friend asked me if I wanted to transfer variables across controllers in YII. I told me about configuration files, redis, memcache, and so on. Finally, I threw it into the session and was despised .. May I ask... for example, the data is shared data (such as site information ). A friend asked me if I wanted to transfer variables across controllers in YII. I told me about configuration files, redis, memcache, and so on. Finally, I threw it into the session and was despised .. What do you think?
Ps: A new php expert.
Reply content:
For example, the data is shared data (such as site information ). A friend asked me if I wanted to transfer variables across controllers in YII. I told me about configuration files, redis, memcache, and so on. Finally, I threw it into the session and was despised .. What do you think?
Ps: A new php expert.
If all users share the information, they can store it in the cache, but they must also store it persistently. for unchanged data, they can store it in the configuration file;
If it is the data of a user's single session, it is okay to put the session. I don't know what tricks your friend has.
It is okay to save some global data, as long as it is not too large. If you just store it temporarily, you can delete it once it is used up.