Notes from Wim Godden, When Dynamic Becomes Static – The Next Step in Web Caching Techniques, 30 September 2014
Speaker Slides
The journey
Original HTML: static
Old-school dynamic: rebuild every time
Dynamic: cache
Dynamic content in static: separate caches in different parts of the page.
More load, multiple web servers: need memory caching that will spread out to all servers e.g. memcache, Redis
Reverse proxy caching: cache everything being requested over and over e.g. Varnish.
ESI
Showed examples of ESI tags where the HTML gets retrieved and inserted where the tag was. But Varnish can’t cache POST or very large files or requests with set-cookie – i.e. user-specific content – so is pointless if user is logged in.
ESI not available due to copyright issues, being re-implemented as SLIC in spare time (i.e. not yet available).
SLIC
Then showed SLIC example using nginx
They use nginx as their reverse proxy – very lightweight and fast, low memory footprint, event-driven so no threads
Nginx stores block definitions from server in shared memory and pushes it to cache. Uses session cookie when getting the parts and stores it in memcache with the user
Can warm up the cache when someone logs in (load in their info)
Because you know which blocks you need you can make a single request to memcache them.
Nginx has excellent and superfast subrequest system, handles thousands of connnections, so need fewer web servers
Code changes needed to use the tags
Template conversion
Any data changes need to be pushed to DB and the cache