Client Pull and Server Push - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Client Pull and Server Push

Description:

META HTTP-EQUIV='Expires' CONTENT ... HTTP-EQUIV='refresh' ... META HTTP-EQUIV='refresh' CONTENT='5' With no URL specified, the same documented is reloaded. ... – PowerPoint PPT presentation

Number of Views:132
Avg rating:3.0/5.0
Slides: 21
Provided by: DaveHol
Category:

less

Transcript and Presenter's Notes

Title: Client Pull and Server Push


1
Client Pull and Server Push
  • Delivering Web content that changes over time.

2
Documents that change atregular intervals
  • Many possible applications
  • stock tickers
  • web based chat
  • collaborative applications

3
Alternatives
  • Custom servers and clients
  • not just web server and browser
  • Client Pull
  • browser asks the server for new copy of the
    document at regular intervals
  • Server Push
  • server forces new versions of the document on the
    client at regular intervals.

4
Client Pull
  • Browser knows that document should be refreshed
    after some time interval.
  • Each refresh is a new HTTP request.
  • HTML META tag supports this.

5
META
  • Found in the HEAD of a document.
  • Supports a variety of functions
  • define variables that are used by search engines.
  • author
  • page generator
  • set document expiration date.
  • include embedded objects (sounds).

6
ltMETA HTTP-EQUIV
  • The HTTP-EQUIV attribute tells the Web Server to
    use the CONTENT attribute to generate HTTP
    response headers
  • ltMETA HTTP-EQUIVExpires
  • CONTENTTues, 29 Feb 2000
  • 235959 GMTgt

7
HTTP-EQUIVrefresh
  • Tells the browser to automatically replace the
    document with another document.
  • automatic forwarding
  • client pull

8
Forwarding Example
  • ltMETA HTTP-EQUIVrefresh
  • CONTENT5
  • URLhttp//www.foo.comgt

how long to wait (seconds)
New page to load (after waiting)
9
Automatic RefreshExample
  • ltMETA HTTP-EQUIVrefresh
  • CONTENT5gt
  • With no URL specified, the same documented is
    reloaded.

10
Client Pull
  • CGI creates a dynamic document set to
    automatically refresh.
  • CGI is run again (next request), this time the
    document may be different.
  • If replacement also contains refresh
    instructions, the client keeps refreshing forever

11
Chat using Client Pull
  • CGI program sends back a web page that includes
    refresh header.
  • web page also displays the latest stuff sent by
    others.
  • Client refreshes the page at regular intervals
    (or whenever user wants).
  • Will work, but potential for lots of unnecessary
    traffic, and response time is not so great

12
Server Push
  • Server does not send a complete document
  • the TCP connection stays open.
  • The client must be told to render the part of the
    response it has received.
  • The client must be told to replace the old part
    with new content.

13
Multipart Document
  • The server tells the browser the document
    contains many parts.
  • browser gets the first part (and knows when it
    has the entire part).
  • server waits a while, then sends the next part.
  • The next part can be a multipart document as well

14
MIME
  • Multipurpose Internet Mail Extensions
  • used to specify content type on the WWW.
  • originally designed for sending things other than
    simple text in email messages.
  • Server tells the client what MIME type a document
    is (Content-Type).
  • Client must have a program that can understand
    this type (and render it).

15
Some MIME Types
  • text/html
  • text/plain
  • application/postscript
  • image/gif
  • image/jpeg
  • audio/x-wav
  • application/zip

16
MIME Multipart
  • multipart/mixed
  • Tells the browser the document type is a series
    of documents of mixed type
  • mixed type means each could be different type of
    document.

17
Document boundary
  • Content-type multipart/mixedboundary"1234567890
    "
  • --1234567890
  • Content-type text/html
  • ltH1gtThis is the first partlt/H1gt
  • --1234567890
  • Content-type text/html
  • ltH1gtThis is the second partlt/H2gt
  • --1234567890

modified to fit on the screen
18
x-mixed-replace
  • Another MIME type
  • x-mixed-replace
  • tells the browser to replace each part with the
    next one received.
  • Can have a CGI that generates multiple parts
    (with some delay in between parts).
  • This is server push.

19
Push based chat
  • Server sends partial document.
  • Whenever server has new stuff to send the client,
    it basically replaces the entire document by
    sending a new part.
  • Server is in control of updates
  • TCP connection stays open the whole time.

20
Other approaches
  • Applet creates connection to the server and can
    retrieve new messages, send new messages, etc.
  • Java (applet) programmer can decide whether to
    keep connection open (or even whether to use TCP
    or UDP).
  • Applet is responsible for drawing part of the web
    page.
Write a Comment
User Comments (0)
About PowerShow.com