Trick: Solving HTTP/2 Server Push caching issues with Service Workers!

When a browser requests a page, the server is sending the HTML as a first response. Then the browser starts working and parses the HTML to find all kinds of embedded assets like JavaScript and CSS. The browsers needs to go back to the server again and ask for these files. Server Push allows the server avoid this round trip and push the files directly together with HTML so no valuable time is lost. Many cloud hosting providers like Cloudflare start supporting HTTP/2 Server Push already: Announcing Support for HTTP/2 Server Push

Sounds great right? There is only one small problem: caching doesn’t work properly since Server Push is not aware of previous visits and will not check cached resources.  Server Push always tells the browser that it is should receive the files from the server, whatever happened before.

Continue reading

Baidu copies Google AMP and launches MIP (Mobile Instant Pages)

During the past few months Baidu has been busy with copying Google’s AMP (Accelerated Mobile Pages Project) and late August they launched MIP, also known as Mobile Instant Pages.

The concept of MIP is basically the same as Google AMP: create an additional page while using only specific HTML markup, hosted JS libraries and a just a predefined set of elements are allowed in combination with local caching. This creates a better user experience due to faster loading content. It is not known yet when Baidu is going to put MIP results into all their search engine result pages: this will probably take another few weeks since they just launched and almost no websites have created MIP pages yet. For some queries, like Olympic Games related keywords, MIP results do show up (link) Another item on the massive to do list next to building AMP pages for many content driven organisations. Example via Dragonmetrics blog:

mip-demo

Why MIP next to AMP?

Censorship: it is likely most users can’t access Google’s servers that host AMP versions.

Documentation and more

– Official (Chinese) guide: MIP Documentation
– Validator: external via NPM package mip-validator 1.2.11 or use the tool within Baidu Webmaster tools Zhanzhang.baidu.com/mip/
– Pages ready? You need to submit then Submit MIP Pages

http2 hosting – 20x faster loading websites!?

http2 hosting

The biggest change to the Hypertext Transfer Protocol in years (since 1999) has been accepted and finalized earlier this year. Currently is it being implemented by many servers and hosting companies because it can truly save a lot of loading time for the average website. With HTTP/2 a multiplexing feature allows it to make lots of request at the same time so page load will not be blocked by CSS or JS files based on a maximum number of connections a browser can make. If you want to know what changed in comparison to the old HTTP protocol, have a look at the following slidedeck by Daniel Stenberg, network hacker at Mozilla:

Continue reading