2 years ago
I will try to describe the problem in as much detail as possible by attaching skins
First
I deployed the backend on the railway according to the guide along with the admin panel, I placed the storefront in Vercel.
__
When the site first loads, I have a lag of 3.5 seconds, or 5.1 at worst.
I tried to solve the issue myself and find the reason, but . to no avail.
Which way can you go to resolve the issue?
46 Replies
punched the pockets locally to the front and to the back
I'm trying to find an opportunity to connect to the front host and from there push packets to the back. I don't know how to do this in Vercel
Maybe from the railway to vercel to break through the packages
2 years ago
This latency you are seeing is very likely due in part to your services being so far apart geographically from one another, your railway service would be located in us-west, and your frontend would likely not be anywhere close that, and who knows where your database is.
you would ideally want to host everything on railway in a single region.
My entire railroad environment is in one state.
And the frontend for Vercel is located in a neighboring state.
As far as I understand
When I log into my domain poly-house.kz
He makes a request to the front, front makes a request to the backend, receives it and sends it to me.
There should be a minimum difference between the front and back since they are located in neighboring states




2 years ago
do you have a link to your website where I can reproduce this delay?
where are you located?
https://www.poly-house.kz/kz
kazakhstan ^_^
I thought it was the images and deleted them
But this saved a maximum of 0.8 - 1.2 seconds
2 years ago
you are quite far away from your servers
2 years ago
who is your domain provider?
2 years ago
both vercel and railway
2 years ago
this is a SSR rendered page right?
2 years ago
are you using a custom domain on your railway services?
2 years ago
this is next right?
2 years ago
the frontend I mean
2 years ago
do you ever have the clients browser call the railway service?
2 years ago
when a user visits your frontend, will their browser ever make a call to the backend that's running on railway?
Yes, product pictures, product descriptions, prices, etc. are stored on the server
Also, when placing an order, the data is stored on the server

2 years ago
sorry but that doesn't quite answer my question, and I'm not too sure how I could clarify further
In order to avoid the option of a delay from the frontend server and domain, I have now deleted all the content, leaving a simple “hello”
And loading is really fast

2 years ago
can you please answer my question
If I understand correctly then no.
It will only call the front, which via the API will call the server part on the railway
2 years ago
okay that sounds like about right
2 years ago
I would recommend running the frontend on railway and connecting to the medusa backend via the private network
Deploy the front locally and connect to the backend?
I’m not sure, maybe my code is simply written very poorly and that’s why there are lags..
2 years ago
deploy the frontend on railway and connecting to the medusa backend via the private network
2 years ago
railway's private network
2 years ago
it allows two services in a project to talk to each other privately
@BrodyI tried various options, now I want to test it by running the front and back on the railway.
Please tell me how can I use npm install instead of yarn and configure the build command

OK
I was able to deploy my frontend application…
This is the same repository that is hosted on Vercel, but here for some reason it fell on 8000 localhost and I can't enter it

2 years ago
why delete?
@BrodyIt didn’t work out and I decided to stop trying and not waste your time
2 years ago
fragly helped you




