HTTP2: the good, the bad and the ugly

I spent last few weeks investigating on HTTP2, the successor of HTTP1.1 and I’d like to share my findings and thoughts in this post.

Let’s start saying that if the question you have in mind at this point is: “Can I really use it today, not only for experiments but also in production?”
My answer would be: “YES, you can!”

First of all, I’d like to share with you the browsers implementation status for this protocol

screen-shot-2016-09-06-at-23-00-23

As you can see from the screenshot taken from caniuse.com it’s definitely well supported on the latest version of the major browsers with some caveats obviously.

If you are not convinced yet, please check this website with one of the browsers that currently supports HTTP2 and look how fast to load is!
I’d suggest to install the HTTP2 indicator Chrome extension to discover how many web apps or online services are using this protocol:

screen-shot-2016-09-07-at-21-41-09

Not yet convince?! OK let’s move to a deeper analysis then!

HTTP2 is a binary protocol with a multiplexing requests method implemented, that means all the browser requests will be handled asynchronously.

This massive change will increase drastically the performance of your application.
Considering at the moment a browser can download simultaneously a maximum of 5 resources per domain (let’s avoid talking about “resource sharding” for now), with HTTP2 we will be able to request all the resources and render them when the browser will accomplish their download, check this demo made with Go Lang for a proper comparison between the 2 protocols and check also the Network panel in the Chrome Dev Tools or Firefox dev tools in order to understand how the 2 protocols differ.

The Good

HTTP2 has really few rules in order to be implemented:

  • it works ONLY with https protocol (therefore you need a valid SSL certificate)
  • it’s backward compatible, so if a browser or a device where your application is running, don’t support HTTP2 it will fall back to HTTP1.1
  • it comes with great performance improvements out-of-the-box
  • it doesn’t require to do anything on the client side but on the server side for a basic implementation
  • few new interesting features will allow to speed up the load of your web project in a way that is not even imaginable with HTTP1.1 implementation

Despite the short list, HTTP2 is bringing a substantial change to the internet ecosystem.
One of my favourite feature is the server PUSH where a server can pass a link header specifying what the browser should download in advance before starting to parse entirely the HTML document.
In this case, we can educate the browser to download several resources like images, css or even javascript files before the engine recognise them inside the DOM, providing a better user experience to our web apps and/or games.

The Bad

There is still plenty of works to do in order to have a great penetration of this protocol, few specs are still on going (read the next paragraph: the ugly) and probably it will take quite few months before we will see a lot of services moving to this new protocol.

A part from the high level overview of the downsides, let’s look what will change on the technical side.

Considering that HTTP2 is not restrict on the amount of requests a browser is doing in order to download resources few techniques for optimising our websites will need to be reviewed or even removed from our pipeline.
Delivering all the application inside a unique javascript file won’t have any benefit with HTTP2, so we need to move our logic downloading only what we need when we need it.
Knowing that downloading large files won’t be a problem we could use sprites instead of several small images to handle the icons of our website.
Probably the different tools like Grunt, Gulp or Webpack will need to review their strategies or update their plugin in order to provide real value to this new project pipeline.

The Ugly

Google Chrome protocol implementation!
Chrome is my favorite browser and I use it extensively, in particular, when I need to debug a specific script or I need to gather metrics from a specific behavior of a web app.
At the moment it’s the only browser that requires HTTP2 server negotiation via ALPN (Application-Layer Protocol Negotiation) that basically is an extension allowing the application layer to negotiate which protocol will be used within the TLS connection.

Considering that OpenSSL integrates ALPN only from version 1.0.2, we won’t be able to enable HTTP2 protocol support for Chrome (from build 51 and above) if we don’t configure our server correctly.
For instance, on Linux OS, only Ubuntu from version 16.04 has that OpenSSL version installed by default, for all the other major Linux version you will either install the newer version manually or you’ll need to wait for the next major OS release.

I’d suggest reading carefully the article that describes this “issue” on ngnix blog before you start to configure your server for Chrome.

Wrap up

HTTP2 is not perfect and probably is not supported as it should be but, definitely, could improve (drastically in certain cases) your web project performance.
A lot of “big players” are already using HTTP2 protocols in production (Instagram, Twitter or Facebook for instance) and the results are remarkable.

Why not starting catching up with the future today?

Advertisement

Open letter to @Adobe and @Adobe Air: the hidden part…

I don’t know if you had already read the open letter that Gary wrote recently discussing about the arguable marketing choice made by Adobe on Adobe AIR but also previously about the Flash Platform in general, but I suggest you to start from there before read this post.

If you know me personally or you are following me in the social networks or reading this blog you should know that I’m a big fan of Flash Platform, in particular of Adobe AIR.
I’m very committed to deliver amazing and cutting edge projects made with this fantastic technology and I’m involved in the community to spread the word about AIR.
From a developer perspective I’m 110% with Gary and the community; an amazing technology like Adobe AIR with really a lots of success behind in terms of developers and companies that adopted this technology and in terms of numbers of apps in released during the past few years in different platform.
AIR, in my opinion, should have a better commitment from the company that create it (partially).
Obviously I agree also that there isn’t any competition between Actionscript 3 and HTML5 (read Javascript), what you can really do with HTML5 is what a flash developer could do 5 years ago more or less.
But you can’t approach a discussion like this talking only from a developer perspective, you and we should see it from different angles also.
What I’m asking you is to follow me until to the end of this post then you can send me an email and ask me if I became totally crazy or insult me with a comment, no worries 😀

I usually goes to Adobe Max since 2006, first MAX organised by Adobe, and I remember quite clearly that few MAX ago during both keynotes nobody said anything related to new Flash Platform improvements or plan for the future of the platform.
At the beginning I was so hungry and I spent literally hours on the phone to talk with Adobe people because the 100% of my business was based on this technology and they can’t really think that HTML5 could be better that Flash Platform, in particular in 2011/2012 where the most coolest websites, RIAs and desktop applications were realised with Flash.
But have you ever tried to think from a different point of view this situation? Let’s assume for few minutes that we are inside the meeting room of the Adobe.
You have an amazing technology that millions of people is using to innovate and create the best software in the world but you are not earning what you expect from it, don’t you believe me? Take a look at this chart (ADBE):

ADBE stock 2011/2012

 

This is the graph of Adobe stock (ADBE) from January 2011 to December 2012, the value of the stock was for few months (close to October when usually Adobe Max takes place) lower than $28 and never greater of $35.
Great, obviously our white collars friends, aren’t so interested about which is the best technology in the market or how many people is using it; they care about numbers, how to increase the profit of the company and make happy the analyst to have a better position in the stocks market and with the shareholders.
These results weren’t so good for Adobe in fact, if you remember well, a lots of people started to leave the company, a lots of team was closed in USA or Europe to move the development side in India or in places where the developers are cheaper and Adobe started his commitment on the big new trend of new web technologies products like the Edge family for instance.
Everybody now knows very well the following story about the new products and how they are trying to improve the way to create websites and apps, and I guess the majority of us it’s not so happy about that.
But let’s take a look again to some numbers, the next graph will show you the Adobe stock value from 2012 to March 2014 basically in the period where Adobe left to push the Flash Platform and started to increase the investment on designers products:

ADBE stock 2012/2014

I think is quite explicit that the politic to start selling their products on Cloud (first big mover in the IT panorama), the decision to try to improve a new technology like HTML5 with new tools and so on, create around the Adobe what the management was looking for!
I agree with you that there are many ways to make money but from the metrics perspective they are going in the right direction and they did the right choices for now.
I’m not an economist and I can’t say if this strategy will pay in the long term but for sure in the short term they arrived where they wanted to be.

With this post I’m not trying to defend Adobe, but after many years where the Flash Platform is in this status I started to leave my angry mood and to interrogate myself on why they took this decision, honestly I can’t say if that it’s the only reason that drives Adobe in these big changes but excluding the technical side that’s the only way I can see this thing and now most part of their decision make finally sense.
All the comments I’ve read in the past and also in these days after the Gary’s letter to Adobe is completely true but often, as developers, we forget that it’s not just a design pattern or a performance optimisation that could save the world, the marketing and the market are the real drivers, in front of them also a big corporation like Adobe could defeated.

ADBE stock 2009/2014

 

UPDATE FROM ADOBE

Chris, the new product manager of Adobe AIR, replied to Gary’s open letter, you can read the answer in the official blog

Review of “Confessions of a public speaker”

I’m so happy to make a review of Confessions of a public speaker because it was an inspire book for me that gave me tons of tricks and confirmed feelings that I’ve when I make speech.

Scott Berkun, the author, is a young guy very passionate about his job, he had a great past working for big companies like Microsoft in IE team and not only.
He wrote great books like Making things happen or The Myths of Innovation, I read only the first one and it was very good.

In Confessions of a public speaker you can find everything that you need to grow your skills like speaker, in fact Scott describes own feelings during particular situation, he talks about how to manage crowd in a room and how to create a connection with people in your room and this is only the beginning…
With his informal writing he shares with us own experiences and a part of him, I think is the best way to teach how to grow like speaker but also like teacher.
He dedicates a chapter to explain different approaches between a teacher and a public speaker, I really appreciate a lots because I found similitudes trough Scott’s book and last course for trainers that I took part last year.
For a teacher and speaker like me this book is like a light in the hell that give me new motivations to do my job better and explain me how to prepare myself in a new way that could give me opportunity to make better speech and give to people more.

I suggest to everyone to have a copy of this book that you are a public speaker or an account of a company, it really help you to prepare better an important appointment and to create a connection with you audience.

Flash Platform, automotive and industrial marketplace

During my last 6 months I take part in a couple of projects that are focused on Flash Platform and “unconventional devices”.
It seems strange, I know, but what I mean with the term “unconventional devices” ?

I mean that I use Flash Platform on embedded system with the purpose to create interface of industrial machine and automotive world.
Solutions based on Flex and AIR have great success for final customer, in particular because client has a great GUI with a cool user experience and he doesn’t lost any features with the hardware.
In fact we mix a couple of technologies to create those software like Python and C++.
Those tehcnologies make dirty work for us and via Socket or JSON, depends on traffic data, we make a bridge with Flex or AIR.
Performance are very cool, CPU processors move from 45% to 70%, optimization task take a great part of our time.

It was so interesting try for the first time AIR 1.5 on linux OS, we use Gentoo and Ubuntu too and I think they are very strong OS in particular development like this one.
Many people was really shocked in front of powerful of Flash Platform GUI from others developers to our clients, they can find from GPS integration until to a VOIP module made with Ribbit, from a wizard that guide user to interact with industrial machine to customization of GUI at runtime; everything in the same application that doesn’t run in a computer! Really awesome!

I saw during MAX that others companies are moving first steps trough automotive world but with Flash Lite, I think that an Intel ATOM processor has more potential and it’s so cheap for industrial market, when will be release new ARM processors (I think ARM 9…), that will be more powerful and cheap too, and Flash Player 10.1 or AIR 2.0 will have more opportunity to approach new marketplaces and also gives to many people great and easy user interface to work with.

Today Adobe releases in Adobe Labs Flash Player 10.1 and AIR 2.0 public beta, it’s a first steps to new opportunity for Flash Platform developers, many devices implements Flash Player and in future I think there will be many more.
So I’d like in a future, to find many “unconventional devices” with a Flash GUI because NOW we could make the history with those technologies.

Presentation Zen: a book dedicates to speakers

This summer, during my flights, I decide to read a book dedicate on how to create AMAZING presentation, so I buy Presentation Zen and in 10 hours more or less I finish it and… WOW, it opens my mind!

Author approach is very simple and start his book saying: “Remember that are only suggestions, this book is not a bible that teach you how to use Powerpoint or Keynote, but it shows you how to approach a real presentation process”.

In fact, if you read the book, you don’t learn how to prepare great slides with slideware (it’s a fantastic term to define presentation’s softwares like Powerpoint or Keynote) but you’ll learn what you MUST think behind a slide… out of your computers world.

Few things that I learn reading Presentation Zen:

  • Avoid bullets list (like this :P)
  • Think about the message before switch on your computer and, if you can, go away from your computer with a pen or pencil and paper, tons of papers
  • You must focus your presentation in ONE MESSAGE and follow it during your slides creation
  • An image is better of 1 thousand of words
  • Presentation must help you during your speech and not substitute you
  • Less is better

There are tons of concepts that can help any kind of speakers from IT world to Yoga teachers (I suppose).

I think could be so interesting for anyone that usually speech for passion in conferences or for everyone that make presentation for work like CEO, marketing people and so on.
If you are interesting to buy this book or give more informations about it, go to author’s blog.

I become Adobe Certified Expert on Flex 3 with AIR, I suggest how to prepare the exam

Today I become ACE on Flex 3 with AIR… I’m so happy!!!
I’d like to suggest some stuff, to prepare Flex 3 ACE exam to help other developers that would try this… experience.

First of all download ACE PDF file where you can find exam outlines on adobe.com site.

Then start you preparation reading Flex 3: Training from the source, the official Adobe press book, I know that it could be so easy for advanced developers but you can find interesting stuff that go in deep about particular arguments.

Another PERFECT resources are Adobe documentations that explain very well and very easily how to use Flex and Adobe AIR API, in particular for AIR the best official stuff is Adobe livedocs.
I suggest to take also others books about AIR because you must remember a lots of things for the exam, so take a look at amazon.com 

Work Work and Work again with Flex! Find little or big projects, it’s not important but you can work in real problem solving issue. Also it’s so important to fix many concepts about how to work with modules, components and so on.

When I was at San Francisco MAX I went to Blaze DS and LiveCycle pre-event and it was very helpful for my preparation because LCDS is a part of exam and I’ve never take in consideration before this learning session, so I think you can take a course about LCDS in your country or town.

When you finish with all those steps you are ready to take the exam and maybe to pass it!

Feel free to comment this post with any questions.

MacWorld but also developer.apple.com

I love Apple so much!

This period is so interesting for MACWORLD and this year I’m so excite to view new iTV, new macbook AIR, new firmware upgrade for iPod Touch (finally I could see emails in my iPod Touch) and new services like rent video! That’s cool.

But also, I suggest to take a look at developer.apple.com, in particular in iPhone section, you must register for FREE and you’ll have a lots of materials about development on iPhone and so on.

There you can also submit your iPhone application and put in apple site. New opportunities ae growing up.
In 2008, I think that we’ll have a lots of changes from AIR to new Macbook AIR (everything we call AIR in 2008, it’s funny!).
I love Apple, I love AIR… and I love 2008!

Code Craft, what a good book!

I bought Code Craft: The Practice of Writing Excellent Code of Pete GoodLiffe on amazon last month.
I’m reading now this amazing book and I want to advise it to all developers that want write better code.
This book isn’t focus in a specific programming language – author writes about C to explain examples – so you can read very well.

It’ so interesting and I hope to have other impressions about this book, you can find table of contents in amazon site and buy Code Craft there.
A very good read for this summer!

Multidmedia announces Pandora Project

Yesterday I read Multidmedia newsletter that announced a launch of a big project codename Pandora.
Multidmedia are working on from 14 months so before Adobe announced Apollo!

This software promises to connect all Multidmedia products and create the next generation of desktop Applications.

We don’t know so much about this project, we will have more information in september but now you can read press release page on Multidmedia site.