Open wwzeng1 opened 1 year ago
💎 Sweep Pro: I used GPT-4 to create this ticket. You have 11 GPT-4 tickets left.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
packages/back-end/src/services/features.ts |
Add the purge logic for CloudFlare, CloudFront, and Google Cloud CDN in the queueProxyUpdate function. This function currently handles the purge for Fastly, so we need to extend it to handle the other CDN providers as well. |
packages/back-end/src/init/config.ts |
Add new environment variables for each CDN provider's specific settings in the ConfigFile interface and in the loadConfig function. These variables will be used in the queueProxyUpdate function to handle the CDN purge. |
docs/docs/features.mdx |
Update the documentation to include instructions on how to set up CloudFlare, CloudFront, and Google Cloud CDN for self-hosted GrowthBook. Add a new section for each CDN provider with the necessary setup steps. |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
[Feature] Support purges for other popular CDNs besides Fastly
sweep/feature/support-other-cdns
Description
This PR adds support for purging content from other popular CDNs besides Fastly in GrowthBook. Currently, the CDN purge functionality only supports Fastly, which limits the flexibility for users who use other CDN providers like CloudFlare, CloudFront, and Google Cloud CDN. This PR extends the purge logic to include these additional providers and adds new environment variables for each CDN provider's specific settings. Additionally, the documentation has been updated to include instructions on how to set up these CDNs for self-hosted GrowthBook.
Changes Made
- Modified
packages/back-end/src/services/features.ts
to add the purge logic for CloudFlare, CloudFront, and Google Cloud CDN in thequeueProxyUpdate
function.- Modified
packages/back-end/src/init/config.ts
to add new environment variables for each CDN provider's specific settings in theConfigFile
interface and in theloadConfig
function.- Updated
docs/docs/features.mdx
to include instructions on how to set up CloudFlare, CloudFront, and Google Cloud CDN for self-hosted GrowthBook.Checklist
- [x] Updated the code to support purges for CloudFlare, CloudFront, and Google Cloud CDN
- [x] Added new environment variables for each CDN provider's specific settings
- [x] Updated the documentation to include instructions on how to set up these CDNs for self-hosted GrowthBook
Related Issue
Screenshots (if applicable)
N/A
I have finished coding the issue. I am now reviewing it for completeness.
Success! 🚀
I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind! Join Our Discord
We use Fastly in GrowthBook Cloud to power our CDN. There is Fastly-specific code to purge the CDN when features change. If a self-hosted GrowthBook deployment also uses Fastly, they can benefit from this code, but not if they use another provider like CloudFlare. Most CDNs provide a way to purge URLs or groups of URLs.
We should add environment variables and code to support more CDNs, specifically:
We should also add some docs and tutorials for setting up various CDNs for self-hosted GrowthBook.