02 Web Application Aspects
02 Web Application Aspects
Basic aspects of
Web Applications
Introduction
1. Request/send data
Logic
Presentation
2. Process
Logic Hypertext Transfer
request / sent
Protocol
data
Data
Data
Client side 3. Delivery data
(Web browser) Server side
slide 2
REST model
4. PUT document
slide 3
Outline
slide 4
Development
Client tier
Server tier
Due to the need for low latency time and to handle high load
current web servers are structured in a hierarchical way that
allows parallel request processing
slide 6
Web server architecture
Web browser
On start-up the web server creates a
2 pool of entities for client handling and
1
opens an interface for incoming
Web server 1 connection requests
Application engine
Request for processing
Web Processing Application logic
browser entity Generated Content
(X)HTML engine
(X)HTML
template
The application engine may use an (X)HTML engine to
combine dynamic content with (X)HTML templates to
generate resulting documents that finally are delivered to
the web browser
slide 8
Web browser architecture
Data
Browser engine persistence
Rendering engine
Display
Networking XML parser Script engine Plug-in engine
Backend
slide 9
Web browser architecture
slide 10
HTTP
slide 11
HTTP 1.1
...
...
slide 14
HTTP 1.1 response message
slide 15
HTTP 1.1 methods
slide 17
HTTP 1.1 communication details
Web Web
browser server
HEAD /folder/indx.html HTTP/1.1\r\n
Required if Host: www.webmailer.ws\r\n
resource is Connection: close\r\n
specified by Accept-Encoding: gzip\r\n
absolute path Accept: text/xml,application/xml,text/html,*/*\r\n
Accept-Language: en-gb\r\n
Content User-Agent: Mozilla\r\n
compressed \r\n
by the gzip
algorithm is
HTTP Status Code: HTTP/1.1 404 Not Found\r\n
accepted
Server: Apache (Unix) PHP\r\n
Content-Type: text/html\r\n
Content-Length: 0\r\n
Date: Fri, 12 Jan 14:25:15 GMT\r\n
Connection: close\r\n
\r\n
slide 18
HTTP 1.1 communication details
Web browser
Web
<html> server
<head>
<title>Example.com</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<img src="banner.jpg" />
<h1 class="center">Welcome!</h1>
<br/>
... 2 1
1
After receiving the
document it is
analyzed for css
2
associated resources
that have to be
downloaded for jpg
presentation purpose
slide 20
HTTP user agent detection
Web Server
POST /cgi/login HTTP/1.1\r\n
// Excerpt from server-side code
User-Agent: Android
String userAgent = request.getUserAgent();
if(userAgent.contains(Android"))
Web pageType = HTML;
Browser else if(userAgent.contains("240x320"))
pageType = 240_320_ADAPTED;
else
Web Page pageType = XHTML;
return pageType;
slide 21
Session handling
slide 22
HTTP/2
HTTP 1.1 has been optimized for simplicity and for applicability to a wide
range of use cases
Though the performance has been improved by HTTP 1.1, the protocol
has not been optimized for performance
Goal of HTTP/2: Provide an optimized transport for HTTP semantics using
multiplexing and header compression
HTTP methods, status codes and semantics are not modified by HTTP/2
Has been approved by the steering group of the IETF for publication as
standards-track RFCs in February 2015
channel
TCP connection
window.addEventListener('storage',
function(event) {
console.log('Value for ' + event.key + ' was changed from'
+ event.oldValue + ' to ' + event.newValue);
});
slide 30
function is called if storage event appears
HTML5 - Indexed Database API
Indexed Database API (IndexedDB) is an API for client-side storage
of significant amounts of structured data and for high
performance searches on this data using keys, indexes or cursors
Database operation result in DOM event that has to be handeled
slide 32
References
HTML5 http://www.w3.org/TR/html5/
Working Draft
RFCs:
HTTP 1.0 spec. http://tools.ietf.org/html/rfc1945
HTTP 1.1 spec. (besides further RFCs)
http://tools.ietf.org/html/rfc7230
http://tools.ietf.org/html/rfc7231
slide 33