Reputation: 3088
Suppose that I have the following firebase function that looks something like this:
functions = require('firebase-functions')
exports.myFunction = functions.https.onRequest((request, response) => {
// Do stuff...
})
After I deploy this function on the web and execute it for the first time it takes it around 10 seconds to finish, but every other execution after the first takes only 2 seconds to finish.
I assume this has something to do with cache.
I would like every execution of my function to run just like the first execution.
Why does this happen and how can I disable this feature?
Upvotes: 0
Views: 764
Reputation: 317487
It's not possible, and it's not really a "cache". Cloud Functions reuses server instances after creating one to service a request. That server instance will continue to run to handle more incoming requests for as long as it likes. There isn't some command or configuration that you can use to shut it down manually.
Upvotes: 2