



fetch with a custom cache key from my Worker to my NOP. The custom cache key formula is: https://${url.hostname}/${language}/${country}/${deviceType}/${url.pathname}${url.search}fetches to my API that would retrieve some data from the db. I also have Cache Rules for my API endpoints, so they're cached in CF after the first request. some-url?test=1 (test in this case is just a random variable here, which does not affect the API request or anything other than the custom cache key), I would get it for ~500 ms the first time and when I do a request for some-url?test=2 I would get it for ~500 ms again. If I refresh any of those I would get it for ~20 ms. I would expect that the test=2 will be already very fast after the test=1 was already executed, because the test query string parameter is not changing anything for the API request.The global rate limit for the Cloudflare API is 1200 requests per five minutes per user, and applies cumulatively regardless of whether the request is made via the dashboard, API key, or API token.
[...]
Enterprise customers can also contact Cloudflare Support to raise the limit to a higher value.
considering mostly performanceIf you're considering mostly performance, that api endpoint always goes back to core so it'll be way slower across the board. The KV binding uses cache in the local dc, and then goes to one of the central stores

public/images) which by default gets no cache (public, max-age=0, must-revalidate) and so the optimizer serves them with this header as well._headers file in the root of the project but they don't seem to get included in the final build../.vercel/output/static/_headers after the build by adding this to the end of the generated file:https://${url.hostname}/${language}/${country}/${deviceType}/${url.pathname}${url.search}some-url?test=1some-url?test=2test=2test=1export const runtime = 'edge';export const runtime = "edge";public/imagespublic, max-age=0, must-revalidate./.vercel/output/static/_headers/images/*
cache-control: public,max-age=360000:08:56.974 Detected the following tools from environment: bun@1.1.4, nodejs@18.17.1, npm@9.6.7
00:08:56.975 Installing bun 1.1.4
00:08:57.120 Downloading Bun v1.1.4...
00:08:58.307 Archive: /tmp/asdf-bun.N6Ve/bun.zip
00:08:59.050 inflating: /opt/buildhome/.asdf/downloads/bun/1.1.4/bun
00:08:59.115 Installing Bun v1.1.4...
00:08:59.216 Bun v1.1.4 is installed successfully!
00:08:59.714 Installing project dependencies: npm install --progress=false
00:09:06.876 npm ERR! code EUNSUPPORTEDPROTOCOL{
async headers() {
return [
{
source: '/cdn-cgi/image/(.*)', // does not work
headers: [
{
key: 'cache-control',
value: 'public, max-age=14400',
},
],
},
{
source: '/images/(.*)', // does not work
headers: [
{
key: 'cache-control',
value: 'public, max-age=14400',
},
],
},
];
},
images: {
minimumCacheTTL: 3600, // this does nothing
loader: 'custom',
loaderFile: './imageLoader.js',
},
}