m-daisuke / spike-nextjs-firebase

Sample code for Next.js and Firebase
0 stars 0 forks source link

Firebase, Cloud Functions周りを調べる #11

Open m-daisuke opened 2 years ago

yossy11 commented 2 years ago

firebase hostingだけでhostingする場合はnext exportで静的ファイル出力してからそれをdeployする形になりそう https://nextjs.org/docs/advanced-features/static-html-export

cloud functionsも利用する場合はhttpsで受け付けたリクエストを全てnextjsのcontrol下においてハンドリングする形になりそう https://github.com/vercel/next.js/blob/f52955ec94e6d1505792b02d88048e18999af5be/examples/with-firebase-hosting/firebase.json#L5

yossy11 commented 2 years ago

cloud functionsで利用する場合、コールドスタートが少し重いかも? https://zenn.dev/ucwork/articles/67663455297629

cloud functionsのoriginはdefaultだとus-central1だが今は変更することもできるっぽい https://firebase.google.com/docs/functions/locations?hl=ja#swift

yossy11 commented 2 years ago

vercelにデプロイするのを視野に入れてもいい https://github.com/vercel/next.js/tree/f52955ec94e6d1505792b02d88048e18999af5be/examples/with-firebase

yossy11 commented 2 years ago

一旦cloud functionsを用いて実装する あまりにも遅すぎるようであればvercelに切り替えるかも

yossy11 commented 2 years ago

Firebaseでcloudfunctions, hostingを利用する場合の連携に関して https://qiita.com/sugikeitter/items/22fcbe67402cd1fb91a1