This example could be simplified somewhat if you're willing to leak the generated `ua` query parameter back to the origin server. Most servers will simply ignore unexpected query parameters, so this is likely to work fine.<p>In that case, you could change the fetch() call to:<p><pre><code> response = await fetch(newRequest);
</code></pre>
And then make sure you set a page rule to "cache everything" on your whole site (otherwise by default HTML won't be cached since it's often dynamic).<p>Then you can remove the explicit `cache.match()` and `cache.put()` calls from this example, since the `fetch()` call will implicitly perform the caching you want.<p>(I'm the tech lead of Cloudflare Workers.)