firebase functions cold start use Express.js node.js get problem

System on firebase functions always have problems that code start. https://medium.com/@siriwatknp/cold-start-workaround-in-firebase-cloud-functions-8e9db1426bd3 So google office https://firebase.google.com/docs/functions/networking const http = require('http'); const functions = require('firebase-functions'); // Setting the `keepAlive` option to `true` keeps // connections open between function invocations const agent = new http.Agent({keepAlive: true}); exports.function = functions.https.onRequest((request, response) => { req = http.request({ host: '', port: 80, path: '', method: 'GET', agent: agent, // Holds the connection open after the first invocation }, res => { let rawData = ''; res.setEncoding('utf8'); res.on('data', chunk => { rawData += chunk; }); ... Two line let me confused. Not only me. const agent = new http.Agent({keepAlive: true}); agent: agent, // Holds the connection open after the first invocation Some guy same me. ...

2020-06-17 · 2 min · 217 words · Me

undefined

新增說明文字 https://www.youtube.com/watch?v=MgLc95nBeNE [ ](https://www.youtube.com/watch?v=MgLc95nBeNE)

2020-06-15 · 1 min · 4 words · Me

mysql json mariadb

最近寫mysql 發現 原來 mysql 在json內容時,也有支援一些操作 https://www.cnblogs.com/chuanzhang053/p/9139624.html https://medium.com/micheh/%E5%9C%A8-mysql-%E4%BD%BF%E7%94%A8-json-5796a65701ad 再加上 mysql 還有另一個譆能 虛疑欄位 GENERATED ALWAYS AS http://blog.changyy.org/2017/09/mysql-json-mysql-57.html 基本上可以把json內的某欄位值當成 virutal colume, 直接輸出 覺得這樣可以玩出很多變化 https://www.cnblogs.com/waterystone/p/5626098.html

2020-06-15 · 1 min · 21 words · Me

nodejs node.js console.log util.format ...args for logging log

For logging mulit args with “%O”``` const util = require(‘util’); function d(…args) { if (typeof (console) !== ‘undefined’) { console.log(’[Logging]’, util.format(…args)); } }

2020-06-12 · 1 min · 23 words · Me

[轉]網站使用體驗三大核心指標 – LCP, FID, CLS

https://www.darrenhuang.com/core-web-vitals-lcp-fid-cls.html?fbclid=IwAR2-n-h0j-BR73sD4Vsino1ObtjDyVe3xkhNcs7xmtcn14Kk84rWO-06lPs 瀏覽器插件 這是官方出的Chrome挿件,能夠在瀏覽時即時回報該網頁的LCP, FID, CLS。

2020-06-03 · 1 min · 5 words · Me