Upload
eugene-kovshilovsky
View
250
Download
0
Embed Size (px)
Citation preview
Eugene Kovshilovsky@mediatemple
* WordCamp Orange County 2016 *
Caching 101
Hello.Eugene KovshilovskyDirector of Engineering at Media Temple@ekovshilovsky@mediatemple
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out • Takeaways• Q&A
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out• Takeaways• Q&A
“A temporary storage space or memory that allows fast access
to data”
Definition of caching
Why does caching matter?
DB WordPress
Web Server
OpCachePHP
WordPress Web
Server ✔
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out• Takeaways• Q&A
Hardware caching performance
RAMSSD HDD -
Spinning Disks
20 GB/s4M IOPS
600 MB/s300K IOPS 200 MB/s
100 IOPS
Performance with multiple servers
Reverse
Proxy
Web App Object
Cache
MySQLWeb App
DB Cach
eCDN Cache
Page Cache
LocalCach
e
LocalCache
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out• Takeaways• Q&A
Hosting environments●Shared hosting●Virtual Private Server hosting (VPS)●Dedicated hosting
Shared hosting
Load Balanc
er
Web App
MySQLWeb App
NAS(SSD)
Application Server
Farm
FileCach
e
FS Cache
FS Cache
DB Cach
e
Dedicated & VPS hostingVPS Hosting
My VPS
VPS
RAM
...
Storage(SSD?)
RAM
Storage(SSD?)
Dedicated Hosting
FileCach
e
FileCach
e
Case Study: Media Temple’s Enterprise WordPress
Reverse Proxy
Web App
Object Cache
MySQL
Web App DB
CacheCDN Cache
Page Cach
e
Op Cach
e
Op Cache
Redis orMemcache
NGiNX,Varnish or
ATS PHP-FPM or
Apache
Content Delivery Network (CDN)
Amazon S3 vs. CDNAmazon S3
●Unlimited FTP server
●Low-cost file storage in one specific geographical region
CDN (Content Delivery Network)
●Proxies and caches web data at edge locations as close to users as possible
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out • Takeaways• Q&A
Caching plugins to check out• W3 Total Cache• Redis Object Cache• BatCache• WP Super Cache
W3 Total Cache• All-in-one• Compatibility check and configuration UI• Page, database, and object cache via shared disk or
Memcache• Drop-in: advanced-cache.php
Redis Object Cache• Object cache only • Simple UI• Object cache with Redis• Not for shared hosting
BatCache• Object cache only • No UI• Object cache with Memcache• Installation requires copying files• Not for shared hosting
WP Super Cache• File-based page cache only • Shared hosting or single server only• Drop-in: advanced-cache.php
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out• Takeaways• Q&A
• If you are WordPress plugin developer → Mimic multiple configuration scenarios.
• If you are a WordPress theme / WordPress site developer → Stage your site and have someone test it.
Takeaways
Agenda• Caching Definition
• Caching Performance• Caching Locations• Plugins to Check Out • Takeaways• Q&A