You should be able to, assuming you aren't doing more than 10 ms. of work rendering the actual page
You should be able to, assuming you aren't doing more than 10 ms. of work rendering the actual page
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.)
msfetch/functions/[[catchall]].jsenv.ASSETS.fetchfunctions/_middleware.ts_routescurlexport 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;
}