Create build with same hash on different servers #11817
Unanswered
ShivamS136
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My problem might be very specific or very general, for that please let me tell you my server architecture:
package.json
andyarn.lock
to both the servers via git.yarn.lock
then in CI/CD I runyarn install --frozen-lock-file
.version
inpackage.json
while git pushing and on change inpackage.json
I runyarn build
in CI/CD.The files inside
build
folder are accessible by CDN so when a request comes to my CDN URL then if they are not available at CDN then the request comes to my website URL i.e. Load Balancer, This load balancer can serve this request by any of my node servers.The issue with this might be like below:
yarn build
on server 1 the hash in static file names may be different than server 2.index.html
is served from server 1 and the asset request gets redirected to server 2 then the user will be having 404 though the file is present on server 1. Same for vice versa.How to handle such a case?
Should I have a separate build server and then
scp
these files to both the servers?Is there any setting in
react-scripts
orcreate-react-app
to have a custom hash name?Beta Was this translation helpful? Give feedback.
All reactions