gpt4 book ai didi

Firebase 托管 - 函数重写定价

转载 作者:行者123 更新时间:2023-12-04 10:40:13 27 4
gpt4 key购买 nike

如果您使用 Firebase 托管 将请求定向到 云函数 通过重写,“通过”托管的请求流量是否会记入 Firebase 托管 国标转出 ? (忽略 Cloud Function 的计费)

换句话说,
Firebase 托管 当请求进来时,函数重写自己会花钱吗?

要清楚,
显然, HTTP 云函数 花钱并有配额。 但是,HTTP 云功能计费除外 , 流量(即字节)通过 Firebase 托管重写将记入 Firebase 托管计费 ?

为了限制答案的范围,答案是 A 或 B:
A. $ 用于函数 + $ 用于通过托管传递的请求字节。
或者
B. $ 用于函数 + 重写不需要任何费用。

最佳答案

更新:
官方答案是A。
我很震惊地发现这一点,所以我询问了我的其他假设。我也发现,

  • 如果 Firebase 托管对受 IAM 保护的函数进行了重写,那么当函数返回“未经授权”响应时,即使是未经授权的请求也会按 GB Transferred 计费。即使函数本身不会为未经授权的请求付费。
  • 如果某个路由上不存在函数重写或文件,那么当 Firebase 托管发送“未找到资源”响应时,您需要支付 GB 传输费用。是的,在您未实现的“未找到资源”响应中发送字符是要收费的。

  • 直接来自官方 Firebase 支持的报价:

    My Question:
    "Does Firebase Hosting bill when sending the "Page Not Found"page when a resource is not found? I would have assumed the answer isan obvious no for that case, but since unauthorized cloud functioninvocations are billed, I don't want to assume anything."
    Support Answer:
    "Regarding the 'Page not Found', I've confirmed with the (Google Firebase) team that it is being billed/allocated to GB transferred/downloads."

    "Regarding your original question, Firebase Hosting bills for thebytes that get served to end users. In the case of Cloud Functions, itdoes not matter whether it's a success or not."

    "Yes, you will be charged both for Cloud Functions invocation, andFirebase Hosting data transferred to. However, if you cache thecontent in Firebase Hosting, cache hits are not charged to CloudFunctions."

    关于Firebase 托管 - 函数重写定价,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59964934/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com