在Polymer应用程序中使用service worker会干扰Firebase托管重写吗?

在Polymer应用程序中使用service worker会干扰Firebase托管重写吗?,firebase,polymer,google-cloud-functions,polymer-1.0,firebase-hosting,Firebase,Polymer,Google Cloud Functions,Polymer 1.0,Firebase Hosting,我尝试在firebase.json中添加一些重写,以在某些路径上调用某些函数,但这些函数仅被调用一次,有时甚至在某些看似随机的时间被调用。我的Polymer应用程序使用service worker预缓存所有视图 我只能认为缓存是我的重写没有一直调用Firebase函数的原因?有什么解决办法吗 另外,登录状态是否与此有关 以下是我的firebase.json: { "database": { "rules": "database.rules.json" }, "hosting"

我尝试在firebase.json中添加一些重写,以在某些路径上调用某些函数,但这些函数仅被调用一次,有时甚至在某些看似随机的时间被调用。我的Polymer应用程序使用service worker预缓存所有视图

我只能认为缓存是我的重写没有一直调用Firebase函数的原因?有什么解决办法吗

另外,登录状态是否与此有关

以下是我的firebase.json:

{
  "database": {
    "rules": "database.rules.json"
  },
  "hosting": {
    "public": "build/es5-bundled",
    "rewrites": [
      {
        "source": "**",
        "function": "test"
      }
    ]
  }
}
以及我的测试功能:

const fs = require('fs');
exports.test = functions.https.onRequest((req, res) => {
    let indexHTML = fs.readFileSync('./hosting/index.html').toString();
    //I tried to limit cache hoping this might solve the issue, don't see any difference
    res.set('Cache-Control', 'public, max-age=10, s-maxage=10');
    res.status(200).send(indexHTML);
})
编辑

我可以确认,当我在Chrome中使用incognito时,只要我使用一个新窗口,每次都会调用我的函数。所以我倾向于认为问题在于缓存。我不确定如何通过这样的方式来解决问题,以使服务人员的目的不被破坏