0

I have an array on the node js server file which holds some static data which will be used again and again. My question is, will that data remain the same for all the users or every user will get an empty array at first?

I am guessing that the array will be the same for all the users since it's on the server and the server will not change

1 Answer 1

1

If you're just storing the array in a regular old variable and your server inspects that variable for every request, then all users will see the same data.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah, my server is gonna inspect that same variable each time a request will be made to a specific endpoint by different users. And does that mean that the data will remain in the array as long as my server doesn't restart?
Thanks, Fred for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.