サーバーでレンダリングされる Angular または Next.js アプリを構築する場合は、最新のウェブ フレームワーク向けのフルスタック ソリューションである次世代の
Firebase App Hosting をご確認ください。
Hosting の使用量レベル、割り当て、料金について理解する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Firebase Hosting の料金は、プロジェクトにおける使用量に基づいています。
Hosting の割り当てはプロジェクト単位であり、サイト単位やチャネル単位ではありません。プロジェクトを Blaze 料金プランにアップグレードして、追加の有料ストレージとデータ転送レベルを利用可能にすることもできます。詳細については、Firebase Hosting の割り当てと料金をご覧ください。
Google Cloud コンソールでプロジェクトの予算アラートを設定することをおすすめします。
Firebase コンソールで Hosting ストレージ レベルとデータ転送レベルの両方をモニタリングします。
Hosting ストレージについて理解する
サイトに新しいコンテンツをデプロイすると、サイトの特定のバージョンのコンテンツと構成を指す「リリース」を作成したことになります。各リリース(新しいリリースと保持されている以前のリリース)に関連するファイルは Firebase に保存されます。これらのファイルは、プロジェクトの Hosting ストレージの使用量として加算されます。
この Hosting ストレージは独立しており、Firebase プロジェクトの他のストレージ(Cloud Storage for Firebase やデータベース ストレージなど)とは無関係です。
Hosting では、個々のファイルに最大 2 GB のサイズ上限があります。
Hosting ストレージの割り当て
Hosting コンテンツのストレージは 10 GB まで無料です。
Blaze プランを利用していない場合、Hosting ストレージが無料の 10 GB の上限に達すると、新しいコンテンツをサイトにデプロイできなくなります。古いリリースを削除するか、Blaze プランにアップグレードする必要があります。
Blaze プランをご利用の場合、Hosting ストレージが無料の 10 GB の上限に達すると、Hosting ストレージの追加容量 1 GB ごとに $0.026 が課金されます。
Hosting ストレージの使用量を制御する
Hosting ストレージ使用量を制御するには、次のような方法があります。
Hosting データ転送について
Hosting がサイトのいずれかのリソースを配信する場合、データは CDN からエンドユーザーへ転送されます。リクエストされたリソースは、Google の CDN キャッシュにすでに存在する場合もあれば(キャッシュ ヒット)、Hosting バックエンドからの取得が必要な場合もあります(キャッシュ ミス)。リクエストされたコンテンツが CDN でキャッシュできる場合は、キャッシュされます。キャッシュ ヒットとキャッシュ ミスはどちらも、プロジェクトの Hosting データ転送の使用量にカウントされます。
Hosting データ転送の割り当て
すべての Hosting サイトは、Google が運営するグローバル CDN を自動的に利用します。これには料金はかかりません。CDN からエンドユーザーへのデータ転送は、毎月 10 GB まで無料です。
Blaze プランを利用していない場合、データ転送量が無料の 10 GB/月の上限に達すると、短い猶予期間の後に、サイトは無効になります。データ転送の課金は 1 か月の使用量レベルに基づいているため、翌月の最初の日までサイトは無効のままになります。Blaze プランにアップグレードすると、サイトをすぐに有効にできます。
Blaze プランをご利用の場合、データ転送量が無料の 10 GB/月の上限に達すると、その月の追加のデータ転送量 1 GB ごとに $0.15 が課金されます。
Hosting データ転送の使用量を制御する
Hosting データ転送の使用量を制御するには、次のような方法があります。
ブラウザが CDN からリソースをリクエストする必要がないように、コンテンツのクライアント側キャッシュを微調整します。キャッシュについて詳しくは、ウェブ デベロッパー向けドキュメントをご覧ください。
実際に表示する必要のない画像や動画は読み込まないようにします。
特定のリクエストを処理する Service Worker を作成します。
予約済みの Hosting URL 経由で Firebase SDK を読み込む場合は、それらの URL の予約済み名前空間に関する重要な情報を必ずお読みください。
以下に、特に PWA で Service Worker を設定する際に役立つリソースを示します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-25 UTC。
[null,null,["最終更新日 2025-08-25 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)"]]