It'll also try `worker` then `browser` if there is no `workerd` key.
It'll also try
worker then browser if there is no workerd key.browser
import * as process from 'node:process';
, whenever I use process.env, the nextjs app doesn't understand "node:process". Is it common to simply duplicate the logic for the cloudflare worker? Even my database calls requires a separate env and it's a bit too integrated. Is it common for folks to duplicate their code logic for CF workers or are people commonly able to reuse logic from their app?

import * as process from 'node:process';
export const getEdgeCacheVersion = () => {
const startMs = Date.now();
const edgeCv = await getRequestContext().env.EDGE_CONFIG.getEnvironmentVariable("CACHE_VERSION"); // EDGE_CONFIG reads env variable.
// Average durationMs: ~100ms, very rarely actually hits 0, but docs says it should run in the same thread mostly?
const durationMs = Date.now() - startMs;
if (!edgeCv) {
return null;
}
logger.debug("Fetched cache key from EDGE_CONFIG", {
cacheKey: globalThis.__cacheKey,
durationMs: durationMs,
}); //
return Number(edgeCv);
}