jeremy
Explore posts from serversCDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
I see, or I can use the following graphql query:
and do subrequest/requests? would that be the same result?
I'm planning to pay for the workers add-on, but not the whole pro plan, which I wouldn't really need
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
alright, I see, thanks
Would "Cache Analytics" from Pro plan would give me this data without doing the math myself, or it's just something not available in the dashboard?
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
I guess with the "Cache Analytics" on the Pro plan minimum?
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
is there a place in the dashboard where I can see the hit ratio analytics for the cache.match from the worker?
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
okay, now I get it, thanks for the patience
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
sorry to be a wall, that's why I am asking for help. I'm not understanding this properly.
Here is a walkthrough:
- api endpoint: api.domain.com
- requests are made to api.domain.com
- workers is trigger on route api.domain.com
Code snippet:
Request n°1:
Request n°2:
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
I’m calling cache.match to see if the request is already cached. If not cached, I’m calling fetch
12 replies
CDCloudflare Developers
•Created by jeremy on 4/24/2024 in #workers-help
Subrequests metrics
Are you sure?
Reading at the following documentation, I'm not understanding it this way:
- "Subrequests are requests triggered by calling fetch from within a Worker."
- "Cached: The number of cached responses returned."
When I'm doing a request to my endpoint, the worker kicks in, and it goes through the Worker fetch logic. If cache.match exists, it returns the cached request, if not, it calls origin (with
fetch
) and cache the response12 replies