Hey I’ve developed myself a lambda function in netlify which retrieves products from FAUNA DB - For some reason these product GET requests are super slow. Based in Estonia - could it be problem with region?
|getproducts?size=4|200|fetch|ProductsPanel.tsx:25|63.9 kB|1.53 s|
|getproducts?size=4|200|fetch|ProductsPanel.tsx:25|103 kB|1.46 s|
|getproducts?size=4|400|fetch|ProductsPanel.tsx:25|101 B|3.05 s|
Basically they contain of BASE64 small image and some metadata about the product.
{
"ref": Ref(Collection("products"), "278661010452120065"),
"ts": 1602010698653000,
"data": {
"name": "iPhone 10",
"description": "eqweqe",
"image": "data:image/png;base64,iVBORw0UoCCYCTkmw671gSSAAcS0zpoElJ4P8D1hO2OYvgc1UAAAAASUVORK5CYII=",
"quantity": "12",
"createdTs": 1602010698313,
"longDescription": "eqweq",
"price": "22"
}
}
For example a 0.2mb request took me 3.16seconds.
My fauna allProducts index looks like this - nothing remarkable imo
{
name: "all_products",
unique: false,
serialized: true,
source: "products"
}
Below is the implementation of my netlify function:
Any help appreciated