cloudflare / templates

A collection of starter templates and examples for Cloudflare Workers and Pages
https://cloudflareworkers.com
MIT License
999 stars 632 forks source link

Swap the if blocks so that the header becomes optional #54

Closed markomitranic closed 3 years ago

markomitranic commented 4 years ago

A very small commit here.

The shouldBypassEdgeCache() method within edge-cache worker requires presence of both request and cached response. In any other case it returns false without using the defaults.

While i do understand the need to support headers, i am not sure that overriding the default will be used at all, or often, especially in the case of wordpress where it is not-at-all trivial to do. Furthermore, i see no edge cases occuring in this way, since we will always force the validation of cookies.