Content pfp
Content
@
0 reply
0 recast
0 reaction

Matthew pfp
Matthew
@mpryor.eth
Any Svelte wizards out there ever had very slow __data.json requests and might know a possible cause of the issue? I'm experiencing the very slow __data.json requests specifically on a certain route in my SvelteKit app deployed on Railway. What I'm seeing: Dashboard __data.json requests are fast (80-470ms) Project routes __data.json requests are consistently slow (8-11 seconds) Regular page loads are fast (10-270ms) Database queries are fast locally and in production (~3-5ms) Using Bun adapter with PostgreSQL database Auth is handled via Lucia I've tried: Optimizing database queries Adding compression for responses Caching session validation Reducing data payload
1 reply
0 recast
5 reactions

Matthew pfp
Matthew
@mpryor.eth
This probably didn't belong in /frontend, sorry. But I think I figured it out. I was using Postgres.js as the driver for PostgreSQL connections when it should have been node-postgres. It seems to have solved the problem, at least for now. Postgres.js was maybe keeping connections open longer than needed due to the prepared statements, which likely caused connection pool exhaustion. Whoops 😅
1 reply
0 recast
1 reaction