I have lots of html reports that I need to store, which then I would like to be able to serve it to my app from an API endpoint GET /:reportID.
My initial and probably dumb approach is to store all of the HTML files on the cloud functions then just send the HTML file if the endpoint is called. This doesn't work because of The maximum size of a single function deployment limitation is only 100MB compressed or 500MB uncompressed.(I have almost hundred thousands of HTML files)
Then I'm thinking to store the files in Firebase storage. Serve it when the Cloud functions is called by downloading it first then send it to the client. I don't think this is a good approach as there are many task involved.
- 2x downloading
- write the file to cloud functions
- delete the file after its being sent
The other way that I could think of is by getting the file directly into my client app. However, I don't use authentication from firebase, so I have a token that needs to be authenticated first. I'm not sure if this is even possible to be added on firebase storage rules.
I'm currently stuck. Anyone can give me some insight on how should I approach this problem?