I have page Users where profiles are displayed with some basic data: profile photo, nickname, age, location etc. When you click on profile, it loads data with ajax and shows user profile in pop up. So you stay on the same page.
But every ajax call needs some time to call serverside code and get data. It is not slow, but I want to make user profile display ultra fast. I was thinking that it would be much faster if I pull all profile data at the first place when I get profiles list. Instead of getting just some data on the Users page, I can pull all profile data. Then I can save the data in javascript as array. When user will click on profile, it won’t make ajax call but it will pull data from javascript array. In this way, I think pop up will be shown rapidly.
So far this is just idea. Is it ok to store data I received in javascript array or is any better method?
use javascript object
get the user info in php and pass them to a function in js in the html
then create a js object and but these value in
and then you can access them by simply call the object
if you whant the name just call
userObject[user_id].nameupdate:
for multiple users by creating an object array i edit the code above