If you are building server-rendered Angular or Next.js apps, check out next-generation Firebase App Hosting, a full-stack solution for modern web frameworks.
Tìm hiểu về mức sử dụng, hạn mức và giá của dịch vụ Lưu trữ
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Giá cho Firebase Hosting dựa trên mức sử dụng của dự án đối với những yếu tố sau:
Hosting bộ nhớ (GB) – Lượng bộ nhớ cần thiết để lưu trữ nội dung của các trang web Hosting (tệp tĩnh và tệp cấu hình).
Chuyển dữ liệu (GB/tháng) – Lượng dữ liệu được chuyển đến người dùng cuối từ CDN của chúng tôi. Mỗi trang web Hosting đều được CDN toàn cầu của chúng tôi tự động sao lưu miễn phí.
Hạn mức Hosting là hạn mức ở cấp dự án, chứ không phải ở cấp trang web hoặc cấp kênh. Bạn có thể nâng cấp dự án của mình lên gói thanh toán Blaze để có thêm bộ nhớ và mức truyền dữ liệu có tính phí. Tìm hiểu thêm về hạn mức và giá cho Firebase Hosting.
Bạn nên thiết lập cảnh báo ngân sách cho dự án của mình trong bảng điều khiển Google Cloud.
Theo dõi cả Hosting cấp độ lưu trữ và cấp độ truyền dữ liệu trong bảng điều khiển Firebase:
Truy cập vào trang tổng quan Mức sử dụng trong phần Hosting của bảng điều khiển.
Bạn có thể xem mức sử dụng cho các khoảng thời gian thanh toán khác nhau cũng như cho tất cả các trang web Hosting của bạn hoặc cho từng trang web.
Khi triển khai nội dung mới cho trang web, bạn sẽ tạo một "bản phát hành" trỏ đến một phiên bản nội dung và cấu hình cụ thể cho trang web của mình. Firebase lưu trữ các tệp được liên kết với từng bản phát hành (cả bản phát hành mới và mọi bản phát hành trước đó được giữ lại). Những tệp này tạo nên cấp độ sử dụng bộ nhớ Hosting của dự án.
Bộ nhớ Hosting này độc lập và không liên quan đến bất kỳ bộ nhớ nào khác cho dự án Firebase của bạn (chẳng hạn như Cloud Storage for Firebase hoặc bộ nhớ cơ sở dữ liệu).
Xin lưu ý rằng Hosting có giới hạn kích thước tối đa là 2 GB cho từng tệp.
Hạn mức bộ nhớ Hosting
Bạn có thể lưu trữ nội dung Hosting miễn phí với dung lượng tối đa 10 GB.
Nếu không sử dụng gói Blaze và đạt đến hạn mức 10 GB bộ nhớ Hosting miễn phí, bạn sẽ không thể triển khai nội dung mới cho trang web của mình. Bạn cần xoá các bản phát hành cũ hoặc nâng cấp lên gói Blaze.
Nếu đang dùng gói Blaze và đạt đến hạn mức 10 GB dung lượng lưu trữ Hosting miễn phí, bạn sẽ bị tính phí 0, 026 USD cho mỗi GB dung lượng lưu trữ Hosting bổ sung.
Kiểm soát việc sử dụng bộ nhớ Hosting
Để kiểm soát mức sử dụng bộ nhớ Hosting, bạn có thể làm những việc sau:
Đặt giới hạn cho số lượng bản phát hành cần giữ lại.
Lưu trữ các tệp lớn hơn bằng Cloud Storage for Firebase. Dịch vụ này cung cấp giới hạn kích thước tối đa trong phạm vi terabyte cho từng đối tượng.
Tìm hiểu về hoạt động chuyển dữ liệu Hosting
Khi Hosting phân phát một trong các tài nguyên của trang web, dữ liệu sẽ được chuyển từ CDN của chúng tôi đến người dùng cuối của bạn. Tài nguyên được yêu cầu có thể đã có trong bộ nhớ đệm CDN của chúng tôi (lượt truy cập bộ nhớ đệm) hoặc có thể cần đến từ phần phụ trợ Hosting (lượt bỏ lỡ bộ nhớ đệm). Nếu có thể lưu nội dung được yêu cầu vào bộ nhớ đệm trong CDN, thì nội dung đó sẽ được lưu. Cả lượt truy cập vào bộ nhớ đệm và lượt bỏ lỡ bộ nhớ đệm đều được tính vào mức sử dụng Hosting dữ liệu truyền của dự án.
Hạn mức chuyển dữ liệu Hosting
Mỗi trang web Hosting đều được CDN toàn cầu của chúng tôi tự động hỗ trợ miễn phí.
Bạn có thể chuyển dữ liệu từ CDN đến người dùng cuối mà không tốn phí, tối đa 10 GB/tháng.
Nếu bạn không sử dụng gói Blaze và đạt đến hạn mức 10 GB/tháng đối với việc chuyển dữ liệu miễn phí, chúng tôi sẽ cho bạn một khoảng thời gian ân hạn ngắn, sau đó các trang web của bạn sẽ bị vô hiệu hoá. Các trang web của bạn sẽ vẫn bị vô hiệu hoá cho đến đầu tháng tiếp theo vì phí chuyển dữ liệu được tính dựa trên mức sử dụng hằng tháng. Bạn có thể kích hoạt lại các trang web của mình ngay lập tức bằng cách nâng cấp lên gói Blaze.
Nếu đang dùng gói Blaze và đạt đến hạn mức chuyển dữ liệu miễn phí là 10 GB/tháng, bạn sẽ bị tính phí 0, 15 USD cho mỗi GB dữ liệu bổ sung được chuyển trong tháng đó.
Kiểm soát mức sử dụng Hosting dữ liệu truyền
Để kiểm soát mức sử dụng dữ liệu Hosting, bạn có thể làm một số việc sau:
Tinh chỉnh hoạt động lưu vào bộ nhớ đệm phía máy khách cho nội dung của bạn để trình duyệt không cần yêu cầu tài nguyên từ CDN. Tìm hiểu thêm về việc lưu vào bộ nhớ đệm trong tài liệu dành cho nhà phát triển web.
Tránh tải những hình ảnh và video mà bạn không thực sự cần hiển thị.
Tạo các worker dịch vụ để xử lý một số yêu cầu nhất định.
Nếu bạn tải SDK Firebase thông qua các URL Hosting được dành riêng, hãy nhớ đọc thông tin quan trọng về không gian tên được dành riêng cho các URL này.
Sau đây là một số tài nguyên giúp bạn thiết lập worker dịch vụ, đặc biệt là với PWA:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[],[],null,["\u003cbr /\u003e\n\nThe pricing for Firebase Hosting is based upon your project's usage of the\nfollowing:\n\n- [Hosting storage](#hosting-storage) (GB) --- The amount of storage space\n required to store the content of your Hosting sites (your static files and\n your configuration files).\n\n- [Data transfer](#hosting-data-transfer) (GB/month) --- The amount of data\n transferred to end users from our CDN. Every Hosting site is automatically\n backed by our global CDN at no charge.\n\nYour Hosting quota is project-level, not site-level or channel-level. You\ncan upgrade your project to the Blaze billing plan to unlock additional paid\nstorage and data transfer levels. Learn more about\n[quotas and pricing for Firebase Hosting](/pricing#hosting).\n\nWe recommend setting up\n[budget alerts](/docs/projects/billing/avoid-surprise-bills#set-up-budget-alert-emails)\nfor your project in the Google Cloud console.\n\nMonitor both your Hosting storage level and data transfer level in the\nFirebase console:\n\n- Visit the [*Usage*](//console.firebase.google.com/project/_/hosting/usage)\n dashboard in the *Hosting* section of the console. \n\n You can view the usage levels for different billing periods as well as for all\n your Hosting sites or for each site.\n\n- Visit your project's\n [*Usage and billing* dashboard](//console.firebase.google.com/project/_/usage)\n in the console.\n\n| When your project is on the Blaze pricing plan, [**set up budget alerts**](/docs/projects/billing/avoid-surprise-bills#set-up-budget-alert-emails) using the console. You can use the [Blaze plan calculator](/pricing#blaze-calculator) to estimate your monthly costs.\n|\n| Be aware that **budget alerts do *not* cap your usage or\n| charges** --- they are *alerts* about your costs so that you can\n| take action, if needed. For example, you might consider\n| [using\n| budget notifications to programmatically disable Cloud Billing on a\n| project](https://cloud.google.com/billing/docs/how-to/disable-billing-with-notifications).\n\nUnderstand Hosting storage\n\nWhen you deploy new content to your site, you create a \"release\" that points to\na specific version of content and configuration for your site. The files\nassociated with each release (both new releases and any retained previous\nreleases) are stored by Firebase. These files make up your project's Hosting\nstorage usage level.\n\nThis Hosting storage is independent and unrelated to any other storage for\nyour Firebase project (like Cloud Storage for Firebase or database storage).\n\nNote that Hosting has a maximum size limit of 2 GB for\nindividual files.\n\nQuota for Hosting storage\n\nStorage for your Hosting content is at no cost up to\n10 GB.\n\n- If you are *not* on the Blaze plan, and you reach the\n 10 GB limit of no-cost Hosting storage, you won't be\n able to deploy new content to your sites. You'll need to\n [delete older releases](/docs/hosting/manage-hosting-resources#delete-release)\n or\n [upgrade to the Blaze plan](//console.firebase.google.com/project/_/overview?purchaseBillingPlan=metered).\n\n- If you are on the Blaze plan, and you reach the 10 GB\n limit of no-cost Hosting storage, you'll be billed $0.026 for each additional\n GB of Hosting storage.\n\nControl usage of Hosting storage\n\nTo control your Hosting storage usage, here are some things you can do:\n\n- [Set a limit](/docs/hosting/manage-hosting-resources#release-storage-settings)\n for the number of releases to keep.\n\n- [Manually delete](/docs/hosting/manage-hosting-resources#delete-release)\n specific releases.\n\n- Store larger files using [Cloud Storage for Firebase](/docs/storage), which\n offers a maximum size limit in the terabyte range for individual objects.\n\nUnderstand Hosting data transfer\n\nWhen Hosting serves one of your site's resources, data transfers from our\nCDN to your end user. The requested resource might already be available in our\nCDN cache (a cache hit) or it might need to come from the Hosting backend (a\ncache miss). If the requested content can be cached in the CDN, it will be. Both\ncache hits and misses count toward your project's Hosting data transfer\nusage.\n\nQuota for Hosting data transfer\n\nEvery Hosting site is automatically backed by our global CDN at no charge.\nData transfer from the CDN to your end users is at no cost up to\n10 GB/month.\n\n- If you are *not* on the Blaze plan, and you reach the\n 10 GB/month limit of no-cost data transfer, we\n offer a short grace period but then your sites will be disabled. Your sites\n will remain disabled until the start of the next month because data transfer\n billing is based on *monthly* usage levels. You can reenable your sites\n immediately by [upgrading to the\n Blaze plan](//console.firebase.google.com/project/_/overview?purchaseBillingPlan=metered).\n\n- If you are on the Blaze plan, and you reach the\n 10 GB/month limit of no-cost data transfer, you'll be\n billed $0.15 for each additional GB of data transferred that month.\n\nControl usage of Hosting data transfer\n\nTo control your Hosting data transfer usage, here are some things you can\ndo:\n\n- Fine-tune the client-side caching of your content so that browsers don't need\n to request a resource from the CDN. Learn more about caching in the\n [web developer documentation](//web.dev/http-cache/#cache-control).\n\n- Avoid loading images and videos that you don't actually need to display.\n\n- Create service workers to handle certain requests. \n\n If you load Firebase SDKs via reserved Hosting URLs, make sure to read\n important information about the\n [reserved namespace for these URLs](/docs/hosting/reserved-urls#reserved_urls_and_service_workers).\n\n Here are some resources to help you set up service workers, especially with a\n PWA:\n - Codelab: [Caching files with the service worker](//codelabs.developers.google.com/codelabs/pwa-caching-service-worker/index.html)\n\n - Documentation: [Service Worker Mindset](//web.dev/service-worker-mindset/#powerful-but-limited)"]]