集 SSL/CDN 於一身的 Firebase Hosting 靜態網站空間 - Brent
===
> 請從這裡開始
# Traditional Hosting
Steps:
1. Buy a domain name
2. Buy a Virtual Machine
3. Configure web server
4. Upload website files
5. Check website function
6. Set up DNS
7. Set up SSL (HTTPS)
8. Set up HTTP/2
9. Set up CDN
# Firebase Hosting
## Reduced steps
1. Buy a domain name
2. Upload website files
3. Check website function
4. Set up DNS
## Service Level Agreement (SLA)
99.95% SLA per month, which means ~22min downtime per month
# Firebase Hosting Concepts
## Project
### Firebase Billing
Spark Plan => Free plan
Blaze Plan => Pay as you go plan
---
### Relation between Firebase and Google Cloud Platform
All Firebase resources **MUST** reside in a project
Firebase project = GCP Project
Spark plan in Firebase = Disabled billing in GCP Project
Blaze Plan in Firebase = Enabled billing in GCP Project
Since most GCP resources (VM, GCS bucket, Cloud SQL..) must enable billing in order to use.
Once you disabled billing in GCP Project, **most GCP resoureces will be deleted in that project.**
## Custom domain with SSL
Automatic deploy Let's Encrypt SSL.
## Ignorefiles from deploying
Almost same as gitignore.
## Custom 404 pages
For better user experience.
## Redirects
For SEO concern:
1. Use 301 for permenant redirect
2. Use 302 for temp redirect
## Rewrites
Rewrite to Cloud Function for firebase(node.js), dynamic hosting.
Rewrite to GCP Cloud Run for microservice(your container), dynamic hosting.
## Custom Headers
* Http headers
* Access control
* Authentication
* Caching
* Encoding
## Version Control
`firebase deploy` = create a new release for you
Clears all your cached static content across the CDN at the same time.
Support rollback to earlier release.
# Support resources
https://firebase.google.com/support
## Firebase status
Status dashboard from Google.
## Community support
Support from Stackoverflow, Google groups etc.
## Technical support
Firebase technical support only.
## Billing support
Any billing concerns can contact Google.