In the previous lesson we discussed HTP teus a server push feature.
So with our server having HTP to enable Let's see a very quick example of how we might use server push.
Note that the subject of server push can be quite extensive and very quickly creep into web development
rather than networking.
Therefore I'll keep this lesson very simple.
I have however linked to some more documentation and guides in the lesson resources.
Should you wish to learn more.
I have the demo site open in my browser and to get a better idea of how this loads at the moment open
the Developer Tools disabling the browser cache here just to ensure we're getting an actual server response
reload and we get the three resources on this page indexed not actually amelle first being the main
request which the browser passes and finds links to both style Dotti assess and thumb not be in G the
browser requests those resources and they are delivered simultaneously over a multiplexed HTP to connection.
What we can do with a server push implementation then is send these two files style dotsie assess and
thumb dot P and G along with this response for indexed age dear mal.
Note however that these browser tools isn't particularly good at displaying how pushed files are delivered.
So instead I'll use a command line tool called N G H T T P.
This is available for all Linux distributions or even for your local development machine.
Should you wish to it from there.
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.
Yes and done so detest our current implementation.
I'll say.
N G H T T B.
With a couple of flags.
N to discard the responses.
Meaning we're only testing them and not saving them to disk.
Why to ignore the self science certificate and S meaning print the response.
Statistics.
Which is exactly what we're interested in.
Post that indexed out h.t. email you are role enter and we see here.
A simple response breakdown confirming that only indexed.
The email was downloaded.
Do that same test again this time.
Adding in a flag meaning also request linked assets for this request so styled as is and fund or be
injy enter.
And again as with the browser we see from the timings that these two files were requested and downloaded
at the same time immediately after receiving indexed HD email what we want to achieve then is to run
the first test.
So not requesting these two linked files but still receive them as a result of requesting indexed Odd
h.t. a mile over to the engine configuration file.
I'll add a new location.
Make this an exact match for indexed HD Mel.
Very importantly however slash indexed h.t. email exactly as we're requesting it.
In which case will perform an H TTP to underscore push or slash style dotsie Yes and the same for Slash
thumb.
Don't be in G.
That's very rudimentary but essentially all we need to push these two files when indexed hard edged
here mail is requested.
Note that we are not specifying the resource itself but rather the request for the resource.
An important distinction.
Save reload the configuration.
Run that first test with out the a flag.
So the one that only gave us indexed updated here Mal enter and this time we get all three files automatically
with this asterisk indicating a pushed response.
Also note the significant reduction in process times and the total time for these linked resources to
be received.
So overall a much faster and more efficient way of delivering Web based content for both the server
and the client.