web server design assignment #3: transfer encoding content negotiation due: 03/24/2010 old dominion...
DESCRIPTION
Methods to Support Same as assignments 1 & 2TRANSCRIPT
![Page 1: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/1.jpg)
Web Server Design
Assignment #3: Transfer Encoding & Content Negotiation
Due: 03/24/2010Old Dominion University
Department of Computer ScienceCS 495/595 Spring 2010
Martin Klein <[email protected]>
![Page 2: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/2.jpg)
Grading
• To be done by an automated program that will test most (all?) combinations– assignment is listed under the day it is to be demoed in
class– each group will give a 3-4 minute status report the
week before an assignment is due!• If you have a question:
– email the class list– mimic the behavior of a well known Apache server
(e.g., www.cs.odu.edu)
![Page 3: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/3.jpg)
Methods to Support
• Same as assignments 1 & 2
![Page 4: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/4.jpg)
Status Codes to Support
• Same as assignments 1 & 2, plus:– 300 Multiple Choice
• use if there are > 1 possible representations• provide html list for a user to pick from
– 406 Not Acceptable• use if there are no possible representations that
match the requested q values
![Page 5: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/5.jpg)
Request Headers
• Same as assignments 1 & 2• and add:
– Accept– Accept-Charset– Accept-Encoding– Accept-Language– User-Agent– Referer– Negotiate
![Page 6: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/6.jpg)
Response Headers• Same as assignments 1 & 2, but add:
– Vary– Content-Language– Content-Location– Content-Encoding– “Transfer-Encoding: chunked”– Alternates– TCN
• Modified– Content-type
• add charset after type if not ISO-8859-1 (ASCII)– see week 8 slides for examples
![Page 7: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/7.jpg)
MIME Types
• Same as assignment #1
![Page 8: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/8.jpg)
Encoding Types
• compress, gzip, deflate, identity, chunked– (see week 7 lecture)
![Page 9: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/9.jpg)
Further Guidance
• Use “chunked” transfer encoding for any dynamically generated server response– i.e., directory listings and 3xx, 4xx, 5xx html snippets– use 2 lines as the “chunk”
• Use these language encodings– en, es, de, ja, ko, ru
• Use these non-ASCII charset encodings– “.jis” -> “iso-2022-jp”– “koi8-r” -> “koi8-r”– “euc-kr” -> “euc-kr”
![Page 10: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/10.jpg)
Further Guidance
• Build “Vary” response header as:Vary: negotiate, header1, header2, …, headerN
• use the “Vary” header only if content negotiation has been performed
• No “default” q values in content negotiation– remember: content negotiation only happens if the
request would have generated a 404 without content negotiation
• Generate structured ETags on selected representation as per RFC-2295 (section 9.2)
![Page 11: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/11.jpg)
Status Code Definition• Generate a 200:
– if there is only a single representation as a result of Accept headers and q values
• Generate a 300:– if there are multiple representations that “tie” in q values OR
the client sends a “Negotiate: 1.0” request header– generate an HTML list showing possible options
• Generate a 406:– if no representations are suitable given Accept headers and q
values– generate an HTML list showing closest options
![Page 12: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/12.jpg)
302 Redirection
## Incoming RE 302 URI# (this overwrites the redirection from A2)#
^(.*)/galaxie(.*) $1/fairlane$2
![Page 13: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/13.jpg)
Keep in mind:Status report in 2 weeks!
![Page 14: Web Server Design Assignment #3: Transfer Encoding Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595](https://reader036.vdocument.in/reader036/viewer/2022082415/5a4d1b7d7f8b9ab0599b9bbe/html5/thumbnails/14.jpg)
START NOW!!!