Hi everyone,
I’m a beginner developer; this is my first time working with Medusa. I’m building an online store with Medusa as the backend and a custom Next.js as the frontend, connected to a Supabase Postgres instance. I’m getting a significant server response delay when I try to add items to the cart.
Issue Details:
• When “Add to Cart” is clicked, the server takes up to 12 seconds to respond (yes, it's a lot), with long waiting times in the network tab despite a 200 OK status
• I’m using fetch to send a POST request to /store/carts/{cart.id}/line-items with credentials: "include" and an API key header
What I’ve Tried:
1. Increased the logging level in Medusa to debug, but it only logs the initial click and task completion 12 seconds later without details.
2. Checked Supabase database performance but couldn’t find specific slow queries
3. Ensured indexing on Postgres, though I’m not sure it’s fully optimized for Medusa (I guess so)
4. Looked into the Server Timing API with Firefox profiler) to monitor performance but need help interpreting the data. Link: https://share.firefox.dev/48u7zXu
Tech Stack:
• Backend: Medusa with Supabase Postgres
• Frontend: Next.js, Tailwind CSS
I’d greatly appreciate guidance on resolving this, especially optimizing Medusa’s setup to improve response times. If anyone has experience with Medusa + Supabase or logging more detailed steps, your insights would be very helpful.
Thanks in advance for any advice you can share 🙂