WEBVTT

00:04.630 --> 00:09.240
In the previous lesson we discussed HTP teus a server push feature.

00:09.340 --> 00:16.950
So with our server having HTP to enable Let's see a very quick example of how we might use server push.

00:16.960 --> 00:23.260
Note that the subject of server push can be quite extensive and very quickly creep into web development

00:23.500 --> 00:25.240
rather than networking.

00:25.240 --> 00:28.270
Therefore I'll keep this lesson very simple.

00:28.270 --> 00:32.740
I have however linked to some more documentation and guides in the lesson resources.

00:32.860 --> 00:34.510
Should you wish to learn more.

00:34.870 --> 00:41.100
I have the demo site open in my browser and to get a better idea of how this loads at the moment open

00:41.110 --> 00:48.250
the Developer Tools disabling the browser cache here just to ensure we're getting an actual server response

00:48.760 --> 00:55.480
reload and we get the three resources on this page indexed not actually amelle first being the main

00:55.480 --> 01:03.700
request which the browser passes and finds links to both style Dotti assess and thumb not be in G the

01:03.700 --> 01:11.200
browser requests those resources and they are delivered simultaneously over a multiplexed HTP to connection.

01:11.380 --> 01:17.650
What we can do with a server push implementation then is send these two files style dotsie assess and

01:17.650 --> 01:23.260
thumb dot P and G along with this response for indexed age dear mal.

01:23.260 --> 01:29.050
Note however that these browser tools isn't particularly good at displaying how pushed files are delivered.

01:29.050 --> 01:33.940
So instead I'll use a command line tool called N G H T T P.

01:34.150 --> 01:39.010
This is available for all Linux distributions or even for your local development machine.

01:39.010 --> 01:40.830
Should you wish to it from there.

01:41.020 --> 01:51.550
But to install it here on a one to using a p t I'll run apt get install n g h t t to client.

01:52.920 --> 01:57.430
Yes and done so detest our current implementation.

01:57.450 --> 01:58.070
I'll say.

01:58.080 --> 01:59.970
N G H T T B.

02:00.090 --> 02:01.910
With a couple of flags.

02:02.050 --> 02:05.060
N to discard the responses.

02:05.070 --> 02:08.890
Meaning we're only testing them and not saving them to disk.

02:09.050 --> 02:15.280
Why to ignore the self science certificate and S meaning print the response.

02:15.330 --> 02:16.600
Statistics.

02:16.620 --> 02:19.150
Which is exactly what we're interested in.

02:19.210 --> 02:24.350
Post that indexed out h.t. email you are role enter and we see here.

02:24.390 --> 02:28.480
A simple response breakdown confirming that only indexed.

02:28.530 --> 02:30.370
The email was downloaded.

02:30.660 --> 02:33.570
Do that same test again this time.

02:33.570 --> 02:40.710
Adding in a flag meaning also request linked assets for this request so styled as is and fund or be

02:40.800 --> 02:42.620
injy enter.

02:42.810 --> 02:48.300
And again as with the browser we see from the timings that these two files were requested and downloaded

02:48.330 --> 02:55.020
at the same time immediately after receiving indexed HD email what we want to achieve then is to run

02:55.020 --> 02:56.190
the first test.

02:56.250 --> 03:02.760
So not requesting these two linked files but still receive them as a result of requesting indexed Odd

03:02.760 --> 03:06.970
h.t. a mile over to the engine configuration file.

03:07.290 --> 03:09.200
I'll add a new location.

03:09.390 --> 03:13.260
Make this an exact match for indexed HD Mel.

03:13.440 --> 03:19.620
Very importantly however slash indexed h.t. email exactly as we're requesting it.

03:19.620 --> 03:30.600
In which case will perform an H TTP to underscore push or slash style dotsie Yes and the same for Slash

03:30.710 --> 03:31.160
thumb.

03:31.170 --> 03:32.700
Don't be in G.

03:33.280 --> 03:39.490
That's very rudimentary but essentially all we need to push these two files when indexed hard edged

03:39.490 --> 03:41.290
here mail is requested.

03:41.290 --> 03:47.800
Note that we are not specifying the resource itself but rather the request for the resource.

03:47.910 --> 03:50.210
An important distinction.

03:50.290 --> 03:53.460
Save reload the configuration.

03:54.340 --> 03:57.370
Run that first test with out the a flag.

03:57.460 --> 04:05.050
So the one that only gave us indexed updated here Mal enter and this time we get all three files automatically

04:05.410 --> 04:08.740
with this asterisk indicating a pushed response.

04:08.740 --> 04:14.920
Also note the significant reduction in process times and the total time for these linked resources to

04:14.920 --> 04:16.060
be received.

04:16.420 --> 04:22.750
So overall a much faster and more efficient way of delivering Web based content for both the server

04:22.840 --> 04:24.250
and the client.
