I am a newbie and I am not very clear about the specific php Execution Mode. Some basic configuration parameters of the website are saved in the database and use memcache memory better? Or is the configuration stored in the PHP file in the form of file read/write, and can be directly used through include? Which efficiency is more... I am a newbie and I am not very clear about the specific execution mode of php.
Some basic configuration parameters of the website are saved in the database and use memcache memory better? Or is the configuration stored in the PHP file in the form of file read/write, and can be directly used through include?
Which one is more efficient?
I feel like the latter, because you don't need to link memcache cache to read data, you can directly use variables. I am not sure, but I am a bit ambiguous. I hope the experts can tell me which one is better, who is more efficient, and how PHP uses the memory.
Thank you !!
Reply content:
I am a newbie and I am not very clear about the specific php Execution Mode.
Some basic configuration parameters of the website are saved in the database and use memcache memory better? Or is the configuration stored in the PHP file in the form of file read/write, and can be directly used through include?
Which one is more efficient?
I feel like the latter, because you don't need to link memcache cache to read data, you can directly use variables. I am not sure, but I am a bit ambiguous. I hope the experts can tell me which one is better, who is more efficient, and how PHP uses the memory.
Thank you !!
If you have installed the cache opcode extensions such as apc, it must be saved to php quickly; otherwise, it is faster memory.
It's faster to put it in the PHP file, provided that you are talking about the configuration file.
The simplest and quickest way is to do a comparative test.
It depends on whether you are a memory-level cache or a file-level cache. If you use redis, memcache, and so on, it must be faster than include. Also, it depends on the size of your include file, there are many factors to influence. If it's just a simple small program, it's okay to use include.
Save it to the php array and save it to the database. The temporary database table is adjusted to the memory mode.