Attach firebase cloud function or cache its data from cloud function call

前端 未结 1 837
刺人心
刺人心 2020-12-22 09:25

I have a frontend component that consists of a chart and several different filters that allow users to filter by data type. However, the data that they are filtering is rela

相关标签:
1条回答
  • 2020-12-22 10:12

    You can write data to the local /tmp disk. Just be aware that:

    • There is no guarantee that the data will be there next time, as instances are spun up and down as needed. So you will need to check if the file exists on each call, and be ready to create it when it doesn't exist yet.
    • The /tmp disk space is a RAM disk, so any files written there will come out of the memory you've allocated for your Cloud Functions containers.
    • You can't reliably keep listeners alive across calls, so you won't be able to update the cache.

    Also see:

    • Write temporary files from Google Cloud Function
    • the documentation on cleaning up temporary files
    • Firebase cloud function [ Error: memory limit exceeded. Function invocation was interrupted.] on youtube video upload
    0 讨论(0)
提交回复
热议问题