0

我正在尝试Last-Modified为我的资源设置标头,以便可以正确缓存它们。但是,当我运行时,出现firebase deploy以下错误:

FIREBASE WARNING: set at /hosting/headers/dstaley failed: permission_denied
Settings Error - Incorrectly formatted "headers" entry in the firebase.json

我的 firebase.json 如下:

{
  "firebase": "dstaley",
  "public": "dist",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ],
  "rewrites": [
    {
      "source": "**",
      "destination": "/index.html"
    }
  ],
  "headers": [
    {
      "source": "**/*.@(js|css)",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "max-age=31536000"
        }
      ]
    },
    {
      "source": "**/*.@(js|css|html)",
      "headers": [
        {
          "key": "Last-Modified",
          "value": "Thu, 28 Aug 2014 16:25:05 GMT"
        }
      ]
    }
  ]
}

该文件看起来格式正确,并且该permission_denied错误使我相信无法Last-Modified使用 Firebase 托管设置标头。有任何想法吗?

4

1 回答 1

2

文档中所述

我们目前仅支持 Cache-Control 和 Access-Control-Allow-Origin 标头作为键。

所以不,你不能(目前)这样做。

于 2014-08-28T19:03:25.337 回答