ms. More CPU-heavy things will increase it (hashing passwords). This is not the same as the time a fetch request takes - a request might take 10 seconds but only use 1ms of CPU Time.
/functions/[[catchall]].js. This code logic works when deployed separately as a cf worker but not when translated to a cf pages function.env.ASSETS.fetch there instead which will try to request the site content 
functions/_middleware.ts for 'all requests, including in front of static files', can't tell if there's any granularity for static files_routes if you wanted: https://developers.cloudflare.com/pages/functions/routing/#create-a-_routesjson-filecurl, or anything that can make HTTP calls. They can be made to respect CORS, but by default do not
When using advanced mode, you need to bundle the workerβCloudflare Pages build system doesnβt handle the bundling (if I recall correctly.)

ms/functions/[[catchall]].jsfunctions/_middleware.tscurl //service worker
const body = JSON.stringify({
eventData: event.data,
shown: true,
})
fetch(`http://127.0.0.1:8788/cf/log-notification`, {
method: "POST",
"Content-Type": "application/json",
body: body,
}) // In CF function.
export async function onRequestPost(context) {
console.log(context)export async function onRequest(context) {
const { request } = context;
let url = new URL(request.url);
// Set the hostname to the original site
url.hostname = "example.com";
let ogResponse = fetch(url, request);
// Now set the hostname to the Cloudflare Pages version
url.hostname = "test-branch.example.pages.dev";
const cfPagesResponse = await fetch(url, request);
// Return the Cloudflare Pages response if it's not a 404
if (cfPagesResponse.status !== 404) {
return cfPagesResponse;
}
// Otherwise, return the original site's response
return await ogResponse;
}