Search code examples
sslcdncloudflarefirebase-hostingddos

Does firebase hosting benefit from CloudFlare?


I was looking at https://material-ui-next.com who seem to be running on firebase hosting and use CloudFlare on top of it.

This raised a question. Do firebase hosting websites need additional layers for things like DDoS protection? As as I am aware, firebase provides SSL, CDN, DDoS and caching out of the box? When would one want to add CloudFlare on top of that?


Solution

  • UPDATE: I've moved from Firebase hosting to Netlify

    While deploying our website (https://mfy.im) we ran into a similar debate. However, we decided to go with Firebase hosting without CloudFlare

    The main reason is the performance:

    • Firebase hosting without CloudFlare: 732ms
    • Firebase hosting with CloudFlare: 1.2s

    Using Firebase config json I was able to configure most of the things that I did earlier in CloudFlare.

    However, if you're not much concerned about performance, I recommend to use Firebase with CloudFlare due to the following reasons:

    • Firebase provides some basic DDOS prevention, but no rate limiting. See: Rate Limiting on Firebase Hosting
    • Brotli compression - Firebase only provides gzip
    • Pricing - only 10GB bandwidth is free. After that, it's $0.15 per GB. If you enable CloudFlare on top of Firebase it will cover most of your bandwidth