Using cache in php script

自作多情 提交于 2019-12-01 23:34:05

There are several forms of caching from within PHP.

If you have access to memcached or APC on your webhost (some shared plans disable this functionality), look them up as they are considered fairly high-performance forms of caching as it utilizes the system memory directly (memcached is more suited for distributed systems).

http://php.net/manual/en/book.memcache.php

http://php.net/manual/en/book.apc.php

If not, look into file caching. PHP comes with a handy file library (documented within the PHP documentation) which will allow you to read/write to files.

http://www.php.net/manual/en/ref.filesystem.php

Lastly, you may look into SQL caching. Although this is not typically recommended in comparison to the other options, data that you wish to store through a database may be an option as well (if you need to link it to other data from within your tables).

http://php.net/manual/en/ref.pdo-mysql.php

Good luck!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!