-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: edge gateway extend cdn resolution with r2 #61
feat: edge gateway extend cdn resolution with r2 #61
Conversation
5c1280c
to
3e95587
Compare
Deploying with Cloudflare Pages
|
93a9bb7
to
311fb83
Compare
311fb83
to
9b4bada
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed, this is fine for now but the gateway should be asking the perma-cache API for the content, not reaching round behind it and grabbing the content from it's bucket.
packages/edge-gateway/src/gateway.js
Outdated
@@ -231,6 +232,36 @@ async function settleGatewayRequests( | |||
]) | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* | |
/** |
packages/edge-gateway/src/gateway.js
Outdated
* @param {string} cacheControl | ||
*/ | ||
async function cdnResolution(request, env, cache, cacheControl) { | ||
// Should skip cache if instructed by headers | ||
if (cacheControl.includes('no-cache')) { | ||
return undefined | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} cacheControl | |
*/ | |
async function cdnResolution(request, env, cache, cacheControl) { | |
// Should skip cache if instructed by headers | |
if (cacheControl.includes('no-cache')) { | |
return undefined | |
} | |
*/ | |
async function cdnResolution(request, env, cache) { | |
// Should skip cache if instructed by headers | |
if ((request.headers.get('Cache-Control') || '').includes('no-cache')) { | |
return undefined | |
} |
Adds R2 as a first layer resolution (in CDN together with cache API). It also adds better header handling for previous convs
Closes #60