chrstrbrts
Senior member
Hello,
Let me explain my question.
Let's say a dynamic website lets clients connect to each other, even if that connection is just the ability to view someone else's profile.
You can think of this website as existing in some "site state" at any given time that is the amalgamation of each user's "client state."
Now, let's say that three users are logged in, Alice, Bob, and Carl.
Alice is viewing Bob's profile, Bob is viewing Carl's, and Carl is viewing his own.
Carl then decides to edit his profile and change his favorite food from pizza, to cheeseburgers.
He edits and then clicks "submit" which sends a signal "down the line" to the server to tell it "Hey, I changed my state in this fashion."
The site's state now needs to be changed as well.
The server scripter pulls the appropriate database and makes the required change.
Awesome.
But lets say that you want this site to let all logged in users be up to date with the current site state.
The server now has to send the info out to all logged in users.
One way is to send new versions of whatever page Alice, Bob, and Carl happen to be viewing, presumably the last page sent out to them.
But, this is inefficient.
Only Bob and Carl are viewing Carl's profile, not Alice.
Alice is viewing Bob's page, and Bob's page has not changed from the first site state to the second.
How does the sever scripter know that Alice's page should not be resent?
Is there a table kept somewhere in a database that has "users" on the vertical and "last page sent" on the horizontal (or vice versa)?
Thanks.
Let me explain my question.
Let's say a dynamic website lets clients connect to each other, even if that connection is just the ability to view someone else's profile.
You can think of this website as existing in some "site state" at any given time that is the amalgamation of each user's "client state."
Now, let's say that three users are logged in, Alice, Bob, and Carl.
Alice is viewing Bob's profile, Bob is viewing Carl's, and Carl is viewing his own.
Carl then decides to edit his profile and change his favorite food from pizza, to cheeseburgers.
He edits and then clicks "submit" which sends a signal "down the line" to the server to tell it "Hey, I changed my state in this fashion."
The site's state now needs to be changed as well.
The server scripter pulls the appropriate database and makes the required change.
Awesome.
But lets say that you want this site to let all logged in users be up to date with the current site state.
The server now has to send the info out to all logged in users.
One way is to send new versions of whatever page Alice, Bob, and Carl happen to be viewing, presumably the last page sent out to them.
But, this is inefficient.
Only Bob and Carl are viewing Carl's profile, not Alice.
Alice is viewing Bob's page, and Bob's page has not changed from the first site state to the second.
How does the sever scripter know that Alice's page should not be resent?
Is there a table kept somewhere in a database that has "users" on the vertical and "last page sent" on the horizontal (or vice versa)?
Thanks.
Last edited: