Cache Object in PHP without using serialize

后端 未结 9 994
眼角桃花
眼角桃花 2020-12-14 12:26

I have a complex object that I create in a PHP script. I am looking for a way to store this object such that subsequent requests do not have to recreate it, or spend time un

9条回答
  •  天涯浪人
    2020-12-14 12:53

    You can rewrite your app to ReactPHP what create webserver in one long-running PHP process (just like Node.js or Web.py). Then you can build your big object once (on server start) as a global variable and access it from request event handlers.

提交回复
热议问题