Caching data in PHP

前端 未结 4 1787
我在风中等你
我在风中等你 2021-02-09 03:05

I\'m developing a site in PHP which has some complex SQL queries and I would like to implement a caching feature to reduce the load on the database.

I\'m just wonderin

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-09 03:41

    You might want to take a look at Zend Cache
    http://framework.zend.com/manual/de/zend.cache.html

    I usually store the result of the SQL queries somewhere (depending on what you are looking for, i.e. sometimes is caching it in $_SESSION ok (user related data), sometimes it's not (big resultsets for not user dependant queries) and then my class just checks if the cache exists and continues accordingly.

提交回复
热议问题