Introduction to ObjectCachingScott CarissThursday, 20 June 13
What is it?• Object caching is for caching data whichmay be computationally expensive toregenerate. E.G. a result from a c...
Why use it?• Speed improvement!• Less wasteful• Reduction in load on queried systems.Thursday, 20 June 13
How to use it?• WordPress comes with non-persistent object caching out ofthe box with WP_Object_Cache(). Use wp_cache_get(...
Demo• Show a plugin that does computationalexpensive queries to the database thatcould benefit from a persistent objectcach...
Not using object cacheThursday, 20 June 13
Using object cacheThursday, 20 June 13
Improvements• Gone from a stats page taking ~19 secondsto get results and display to ~1 second.Thursday, 20 June 13
Upcoming SlideShare
Loading in …5
×

Introduction to WordPress object caching

419 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
419
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to WordPress object caching

  1. 1. Introduction to ObjectCachingScott CarissThursday, 20 June 13
  2. 2. What is it?• Object caching is for caching data whichmay be computationally expensive toregenerate. E.G. a result from a complexSQL query.• You can have persistent and non-persistentobject cache.• Object Cache can be stored in memory(RAM), on disk or in a database.Thursday, 20 June 13
  3. 3. Why use it?• Speed improvement!• Less wasteful• Reduction in load on queried systems.Thursday, 20 June 13
  4. 4. How to use it?• WordPress comes with non-persistent object caching out ofthe box with WP_Object_Cache(). Use wp_cache_get() andwp_cache_set()• If you want to use persistent caching then decide where youwant to store your object cache, in memory is the quickest.• Install a WordPress persistent object caching plugin.W3 TotalCache,WP File Cache and APC Object Cache to name afew.• If coding your own plugins and themes use wp_cache_get()and wp_cache_set() to store and get data from the objectcache.Thursday, 20 June 13
  5. 5. Demo• Show a plugin that does computationalexpensive queries to the database thatcould benefit from a persistent objectcache.• Show how to install APC object cacheplugin to WordPress.• Re show the same plugin now using apersistent object cache.Thursday, 20 June 13
  6. 6. Not using object cacheThursday, 20 June 13
  7. 7. Using object cacheThursday, 20 June 13
  8. 8. Improvements• Gone from a stats page taking ~19 secondsto get results and display to ~1 second.Thursday, 20 June 13

×