Extension:CentralNotice/Caching Overhaul -- Edge Side Includes

Objective
Allow CentralNotice to deliver content via Varnish Cache Edge Side Includes. Primarily this is going to allow CentralNotice to reduce the number of off page requests during initial banner load to only 1 (2 for the first time a user visits the site.)

In the end we hope to present this as a template for including edge fragments such that we can completely separate MediaWiki chrome from page content.

Architecture Visualization

 * 1) Inject static script in the CentralNotice DIV which 'preloads' CentralNotice content from Varnish. This is not the controller, that will still be loaded from ResourceLoader.
 * 2) This must be on a different domain than bits because we will be sending up cookies (userstate/country/language/project/?)
 * 3) Backend script will construct snippet document containing banner content
 * 4) Varnish will have to know how to vary on this


 * Varnish/Snippet handler must know how to
 * Emulate X-Vary-On
 * Hook into existing cache purge schemes
 * Grace timeout of 10seconds? (Serving stale content while looking to the backend for updated data)


 * CentralNotice must improve its purge scheme
 * Move to a purge on demand instead of purge on time

Useful Coordination Links

 * Parsoid Longer Term Plan RFC