Added auto-switch to CDN based on debug mode