Wrap text to 120 characters.

This commit is contained in:
Steven Benner
2012-07-12 01:27:43 -07:00
parent ceb45bcb4a
commit 721889ad08

View File

@@ -4,9 +4,17 @@ isChild: true
## Object Caching ## Object Caching
There are times when it is advantageous to cache individual objects in your code, such as with data that is expensive to get or database calls where the result is unlikely to change. You can use object caching software to hold pieces of data in memory for extremely fast access later on. If you save these items in a data store after you get them then access the data for following requests from cache you will see significant performance increases and reduced load on your database servers. There are times when it is advantageous to cache individual objects in your code, such as with data that is expensive to
get or database calls where the result is unlikely to change. You can use object caching software to hold pieces of data
in memory for extremely fast access later on. If you save these items in a data store after you get them then access the
data for following requests from cache you will see significant performance increases and reduced load on your database
servers.
The most common memory object caching systems are APC and memcached. APC is a great choice for caching, it comes with PHP and is very easy to setup and to use, but it is tied to the server it is installed on. Memcached on the other hand is installed as a separate service and can be accessed across the network, meaning that you can store values in a hyper-fast data store in a central location and many different systems can pull from it. In a networked configuration APC will outperform memcached in terms of access speed, but memcached will be able to scale up faster and further. The most common memory object caching systems are APC and memcached. APC is a great choice for caching, it comes with
PHP and is very easy to setup and to use, but it is tied to the server it is installed on. Memcached on the other hand
is installed as a separate service and can be accessed across the network, meaning that you can store values in a
hyper-fast data store in a central location and many different systems can pull from it. In a networked configuration
APC will outperform memcached in terms of access speed, but memcached will be able to scale up faster and further.
Example logic using APC: Example logic using APC: