I would like to suggest adding a feature that allows forum administrators to configure Cross-Origin Resource Sharing (CORS) settings directly from the admin panel.
Problem Statement:
Many forum owners rely on Content Delivery Networks (CDNs) to accelerate their websites. However, two common issues arise:
Cross-origin errors – When a CDN is used, the forum’s origin server may differ from the domain requested by the user’s browser, causing CORS policy errors that break API calls and AJAX requests.
Performance variability – Cloudflare CDN, which is widely used by FreeFlarum forums, has poor performance in certain regions. Administrators may wish to switch to other CDN providers or use custom domain setups to mitigate this, but the current lack of flexible CORS configuration prevents them from doing so without breaking cross-origin functionality.
Proposed Solution:
Implement a setting in the global admin panel that allows administrators to define custom allowed origins (e.g., Access-Control-Allow-Origin). This would give admins the flexibility to whitelist their CDN domain(s) – whether it’s Cloudflare, another CDN, or a custom backup domain – effectively resolving cross-origin issues and allowing them to choose the best-performing CDN for their users.
Benefits:
Improved Compatibility: Eliminates CORS errors when using any CDN.
Enhanced Flexibility: Empowers admins to switch CDN providers or customize origins based on their regional needs, without being locked into a single solution.
Better User Experience: Prevents users from seeing cross-origin errors and ensures faster loading times by allowing the optimal CDN choice.
I believe this feature would provide significant benefit to a large portion of FreeFlarum’s user base, as many forums experience both CORS issues and regional CDN performance problems.