This worker script will evaluate your origin response, and replace html comments marked as fragment:key with a respective prefetch defined in a X-Fragments response header.
Your origin must include the X-Fragments header, specifying the a comma separated list of prefetch requests to make for that response.
< HTTP/1.1 200 OK