Caching Small Big Things

Andrey “Rarst” Savchenko, WordCamp Switzerland 2014

Caching Small Big Things

Andrey “Rarst” Savchenko

Map

Caching
 

Switch set to On
Caching Challenges

Rarst.net load time

Load Time Map

Apdex
( satisfied + tolerating / 2 ) / total

Rarst.net apdex — 0.87

Apdex Score

$ € £
What is visit’s potential worth?
( ask aloud — you’ll be surprised )
¥ ₽ ₴

Gotchas of full page cache

HTTP Cache

304 Not Modified symfony.com/doc/2.4/book/http_cache.html

Edge Side Includes ( ESI )

<esi:include src="http://example.com/1.html" /> w3.org/TR/esi-lang

Fragment cache

Gotchas of fragment cache

Transients API

codex.wordpress.org/Transients_API

TLC Transients

GitHub Logo/markjaquith/WP-TLC-Transients

Fragment Cache ( the plugin )

GitHub Logo/Rarst/fragment-cache

Plugin responsibilities

Handler responsibilities

Magic is slow

KittenPress site mockup
Generation time heatmap
component time
menu 9%
sidebar 39%
gallery 47%
content 5%

Gallery fragment handler

Generation time heatmap
component time
menu 16%
sidebar 72%
gallery 2%
content 9%

Widget fragment handler

Generation time heatmap
component time
menu 59%
sidebar 4%
gallery 4%
content 33%

Menu fragment handler

Generation time heatmap
component time
menu 9%
sidebar 9%
gallery 9%
content 73%

But how much faster is it?

component improvement
menu ×19
sidebar ×80
gallery ×97
total w/ content ×19

Never just “On” a cache

  1. Implement
  2. Monitor
  3. Profit

Thank you for listening! Questions?

Rarst.net/slides/caching