Static vs Dynamic Webpages
Lonce Wyse
Communication & New Media
lonce.wyse@cnm.nus.sg
Static Web pages
- The same for each visit
- The same for each visitor
- To change, content must be changed by the designer/developer
Dynamic Web pages
- Can be responsive to user info
- Change depending on real-time data
- Content *created* when it is requested
Dynamic Web pages
- Can be responsive to user info
- Change depending on real-time data
- Content *created* when it is requested
Changing Data
Server Code
Are the games and animations sites we've developed "dynamic"?
Not as far as the server is concerned.
Dynamic Web pages
- Can be responsive to user info
- Change depending on real-time data
- Content *created* when it is requested
Changing Data
Server Code
(Minimally) Dynamic Web pages
- Can be responsive to user info
- Change depending on real-time data
- Content *created* when it is requested
Server Code
Dynamic Web pages
- Stock Market trading/visualization
- Database constantly being updated
- Shopping sites
- Database constantly being updated with new products, new prices
Typically involves a DATABASE from which the webpages that are served are created at the time they are requested.
Q: Why do github.io (and others) only host static pages?
Multi-user interaction
"Chat room" model
Socket connection established for each site visitor
Any messages server receives, are 'broadcast' to all other sockets.
Sockets
Socket enables real-time two-way communication
Each client gets a different socket number, or "id" to use once the connection is established.
1
2
OK, let's write some client & server code
for
multiuser interaction!
008.010.000_TheActiveServer
By lonce
008.010.000_TheActiveServer
node and Express for serving files
- 342