CDN Caching Completely breaks my page
fgr02
PROOP

a month ago

We recently (today) switched from Vercel to Railway to keep our entire tech stack on Railway. As soon as I set up the DNS for our website (https://www.turnera.com.ar), it slowly propagated and loaded successfully on our customers' computers/phones; I also enabled CDN caching. A couple of minutes after we had completely switched, we started getting an error after the users logged in to our /plataforma page (has some redirect logic depending on the user type) where it returned the following page:

image.png

Clearing the cache fixed the page but after a bit of time it started failing again. i ended up disabling html caching overall and it seemed to fix this login page, but then another error started occurring on our plataforma/establecimiento page where it permanently reloaded the page to no end. Again clearing the cache seemed to resolve the issue but after a bit of time it reappeared again. now we have completely disabled CDN caching and no errors are happening. If you require any information to assess the problem please ask for it and we will provide it, we truly like railway and would like to maintain all of our services here (front and back)

Solved

1 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 28 days ago


a month ago

We tracked this down to an edge case involving your redirect setup and Next.js React Server Components (RSC).

Next.js serves both HTML and RSC payloads from the same URL, using special headers and an _rsc query parameter to distinguish them. Your redirect dropped that param, which could cause our CDN to return the wrong response format. We’ve updated the cache keying to include the RSC and Next.js router headers directly, so HTML, navigation, and prefetch responses stay separate even when _rsc is missing.

We verified the fix against a reproduction of your setup: HTML and RSC responses now cache independently and return the correct format in either request order.

This was a subtle interaction with Next.js’s request behavior, not somethng you explicitly configured incorrectly. Thanks for helping us track it down, and sorry for the disruption. Feel free to re-enable CDN and let me know how it goes.


Status changed to Awaiting User Response Railway • 27 days ago


Railway
BOT

20 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 20 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...