You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//add a sessionID in the text to ignore the sender who sent
import { pusherServer } from "@/pusherConfig"
export async function POST(req: Request) {
const { text, roomId, channel } = await req.json()
//ADD AWAIT HER
await pusherServer.trigger(roomId, channel, text)
return new Response(JSON.stringify({ success: true }))
}
pusher is blazing fast like 100ms only to send and recieve a msg from different channels on dev mode however when i deploy it it becomes very slow (i am using ap1 singapore pusher servers, i live in hong kong). i am deploying it on vercel and for some reason it is quite slow espeically the first pusher msg which i send which takes like 3-4 seconds and the ones after take 1 - 2 seconds.
I have set NODE_ENV to production and my next config looks like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
frontend
next app API side
calling it in frontend
pusher is blazing fast like 100ms only to send and recieve a msg from different channels on dev mode however when i deploy it it becomes very slow (i am using ap1 singapore pusher servers, i live in hong kong). i am deploying it on vercel and for some reason it is quite slow espeically the first pusher msg which i send which takes like 3-4 seconds and the ones after take 1 - 2 seconds.
I have set
NODE_ENV
to production and my next config looks like this:Beta Was this translation helpful? Give feedback.
All reactions