Understanding caching






@stompweb
Steven Jones

What is caching?



Store expensive operations for quick retrieval 


Examples:
 Remote data
Large Database queries

Where is it stored?


Database
RAM
Browser

What types of Caching?


Opcache
Browser Caching
Page Caching
Fragment Caching
Object Caching
Database Caching

Page caching


Super fast - caches the HTML
Limited/Inflexible

Could use Javascript to make more flexible.

WP Super Cache
W3 Total Cache

Object Caching


Persistant vs Non Persistant

Transients

Store chunks of data

WP_Query good for this; Filter the main query, don't do your own database query.
https://gist.github.com/kovshenin/3001645

Be aware of uncached functions such as get_posts()
http://vip.wordpress.com/documentation/uncached-functions/




Fragment Caching


Cache part of your page

Browser caching


Local storage vs SESSIONS etc

Images/Assets - set expires

AppCaching - 
http://wordpress.org/plugins/wp-appcache/

Database caching


MySQL already does caching

Non-deterministic MySQL functions such as NOW() will by-pass MySQL’s query caching

References


http://webdevstudios.com/2014/11/04/hacking-wordpress-search-for-fun-and-profit/

http://fsquaredesign.com/elasticsearch/#/38


http://xspell.tk/?page=api


Title

Caching with WordPress

By Steven Jones

Caching with WordPress

Coming soon...

  • 2,079