-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
It appears that all requests sent using the HEAD method are passed on to the backend servers, which can make a site easy to overload with a flurry of this type of request.
According to Cloudflare's docs,
cache.put will throw an error if:
- The request passed is a method other than GET.
This is in contrast with Cloudflare's default behaviour for caching HEAD requests:
When you make a HEAD request for a cacheable resource and Cloudflare does not have that resource in the edge cache, a cache miss happens. Cloudflare will send a GET request to your origin, cache the full response and return the response headers only.
To verify this behaviour on a site using the worker, compare the cf-cache-status header returned for a request made with GET:
curl -v [URL] 2>&1 | grep "cf-cache-status"
# < cf-cache-status: HIT - at least from the second request onwardswith the same request made with HEAD:
curl --head -v [URL] 2>&1 | grep "cf-cache-status"
# < cf-cache-status: DYNAMIC - alwaysReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working