Cache Object in PHP without using serialize

后端 未结 9 1048
眼角桃花
眼角桃花 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:51

    in this case a better option would be to write your own server.

    it's easily doable in php - and you already have the code - but php may not be the first choice of most when it comes to writing servers.

    • it may become the new bottleneck of your app (as php is not really multithreading-ready and requests are answered serially)
    • not all hosters allow custom cli scripts
    • if your decision tree changes, you have to notify your server to rebuild the tree

提交回复
热议问题