An overview of Accelerated Mobile Pages Project at YGLF 2016.
See how you can leverage this important open source project today in production and improve your sites’ performance and the happiness of your users.
Category Archives: webdev
Accelerated Mobile Pages Tips
TL;DR
AMP is an effort to build an open solution that would improve the mobile web experience for everyone. It is a new way to build web pages for static content that render fast (e.g. an article, a tasty recipe, blog post). AMP in action consists of three different parts:
- AMP HTML is HTML with some restrictions for reliable performance and some extensions for building rich content beyond basic HTML.
- AMP JS library ensures the fast rendering of AMP HTML pages.
- Google AMP Cache can be used to serve cached AMP HTML pages.
Tips
Make sure that your AMP pages are valid
From AMP To PWA
The slides from my talk today at Google IL office.
It’s all about building a great mobile experience for your users.
From AMP (=Accelerated Mobile Pages) as a starting point up to PWA (=Progressive Web Apps).
As a bonus, we also showed new APIs like: Payment API, One Tab Sign-in and Physical Web that expending the web even farther.
Progressive Web Apps Event At Campus TLV
Progressive Web Apps are experiences that combine the best of the web and the best of apps. They load quickly, even on flaky networks, can re-engage with users by sending web push notifications, have an icon on the home screen and load as top-level, full screen experiences.
Here are the slides from the keynote I gave today at Campus TLV.
If you want to see it in action, click on the image below.
How To Build A Progressive Web App?
Why?

How?
- First step: I strongly recommend trying out the PWA code lab so you understand how the approach to this type of app may be similar (or not) from what you’re used to do.
- Tech: Evaluate whether you’re going to just use vanilla JS for your app or a library/framework. See here for barebones PWA config or try Web Starter Kit for a starting point with a build process (=Gulp). Your PWA should supports the application shell architecture for faster first-paint and persistent.
- Offline support: There are few libraries for helping you with Service Worker pre-caching (sw-precache) and runtime caching (sw-toolbox). You can check this code lab for building your first offline web app as a starting point.
- User Interface: Like anything on the web, there are lots of options for your UI. Some of the example PWAs take advantage of Material Design and there are libraries for using it available for vanilla JS, Polymer Paper elements, Angular Material and community efforts like Material UI for React.
- Icons: I find both iconfinder.com and realfavicongenerator to be good resources. If you have the budget, it’s always great to get something polish from a designer.
- Performance: Please follow the RAIL performance model:
- Cable:
- First load (network-bound), First paint at 1s or sooner, Speed Index of 1,000 or less, <100ms for response, <16ms for each frame.
- Second load: first paint at 300ms or sooner, Speed Index of 1,000 or less.
- 3G:
- First load (network-bound), 3G (normal, as defined by WPT): First paint at 2s or sooner (including TLS handshake), Speed Index of 3,000 or less.
- Second load (disk-bound because SW): First paint at 300ms or sooner, Speed Index of 1,000 or less.
- Test your work with WebPageTest and Chrome DevTools.
- Cable:
- Examples
- Smaller Pictures – A great web app that will help you shrink photos.
- Air Horner – The ‘must have’ web app for the olympics in the summer.
- Voice Memos – Very useful when you have conversations with your spouse.
- Offline Wikipedia – If you need to read something on the plane.
- Guitar Tuner – For the ones that needs to tune their guitar.
- Zuperkulblog – Good if you thinking on a PWA for publishers.
- Snapdrop – an Apple Airdrop in HTML.
- More on this pwa-list.

The main features for progressive web app
Misc
- Alex Russell – intro post to the topic.
- The Angular team have also started an early ng2-application-shell project based on the app-shell architecture.
- Addy Osmai great post: “Getting started with PWA”
- FlipKart’s case study – With lots of good technical tips.
Be strong and build something amazing!
Progressive Web Apps – Noter
Progressive web apps are the future, and here is a demo that I built in order to feel the current challenges.
How about a little tool that let you take notes?
Yes, not too original, but still useful.
It is currently can be found with 2 versions:
- Basic version – It contain service worker for offline, manifest and a simple text area. All the basic functionality, that allow you to take notes the are saved automatically with or without connection. I used jQuery and bootstrap to keep it simple and to make it easy to extended it in the future.
- Full version with Firebase – Similar to the basic version, but this time, I added the ability to save the notes in the cloud (=firebase). You can add notes, edit current ones and (of course) delete the ones that you don’t really like. The text area was upgrades to a markdown editor. A simple one, but still something that will give you the ability to get a preview of the note in a markdown.
You can use:
User – demo@demo.com
Password – demo
See below how it will look like after you login.

It’s still “work in progress” and you can see at the current TODOs at the bottom of the code repository.
Challenges and Tips
You can see the main tips that I got from working on this demo in the image below.
The most important checkbox is “force update on page load” – It will make sure you are getting your new version and not the one that the service worker already cached.
Another good way to see what is going inside your service worker is to click on the link ‘sw.js’ above this checkbox.

So to wrap-up, the code for this demo can be found at Noter on github and the live demo.
Please try it on your Android and let me know if you find something that is broken or can be better.
Happy note taking and may you always write good and productive ones.
Building a Progressive Web App

I think the web platform is awesome.
Moreover, it got some impressive APIs that make it even more powerful. The web platform is easy to access (very low friction), no installs, easy distribution (without walled gardens), immediate redeployments and no single organization own it. Let’s see what do we mean when we are talking on progressive web apps.
Progressive Web Apps
- Fast loading – Because we know users love speed and for every delay we are lossing a smile (and a user).
- One click away from accessing content – You should have an icon on the screen and with one click you could get to your content (or task) and smile.
- Smooth animations and navigations – Good UX comes with these aspects.
- Re-engages with push notifications – In many cases, we wish to be able to notify users even when the browser is not open in-front of them. We can!
- Good experience on flaky network connections – Our web app is offline first, so we can deliver our content (just the deltas) on flaky networks much better/faster.
- Consistent experience across browsers – After all, we are talking on the web here. You can’t control from which device users will come to your work. So make sure, you serve them all.
PWAs are about the experience, no the tech: these apps _feel_ better and more app-like. The technology behind Progressive Web Apps is called “Service Worker”; it’s available only since mid 2015 and is seeing large, growing adoption. PWA is expected to be for mobile what AJAX meant for the desktop web.
Enabling app-like capabilities
At the foundational level, there are two core pieces of technology that enable PWAs: Continue reading
Progressive Web App?!
We have today on the web capabilities to create web apps that feel and act like a native application.
Yes – We do.
We can have offline first, push notification even when the browser is running in the background and add to home screen. These three features bring us to a point where we can give users our content and features with one click and with all the benefits of the web.
What is this new monster you ask?
Well, let’s try to describe it and give few examples. Continue reading
Chrome 50 And Web News
Web Bluetooth
You can access user-selected Bluetooth devices over GATT.
You can try it in Chrome behind flags:chrome://flags/#enable-web-bluetooth
If you wish to learn more on the web Bluetooth, try this the demo code.
Last note, for more details on the implementation (e.g. which pieces are done in which releases) star this repo github.com/WebBluetoothCG/
DevTools
Want to stay updated with all the new powerful features that Chrome DevTools got for you? Check this DevTools Tonight show pilot or a daily tip.

Monetization
Learn about Monetization (from web/app to bitcoins and more!) with this new series we created on Google Developers Channel.
Btw, if you like blog posts, we got you covered as well right on this blog.
Async CSS
Controlling async CSS using custom properties. Turns out they’re quite powerful.
Since <link> in the <body> blocks the parser while the CSS loads, it might be good to build a dependency mechanism where each element is render-blocked until other specific elements have rendered.
Sounds complicated?
It’s not. Check this demo (please make sure to try it with Chrome Canary or Firefox). In this demo, the CSS is loaded async, with each sheet taking randomly between 0-5 seconds to load. Despite this, the page never renders out of order, and each section renders as soon as possible depending on the browser width.
Progressive web apps
Wanna see some good examples of Progressive web apps? This is the new way to build for the web at 2016.
We wish to have a web app got:
- Fast loading – Since we are caching everything and using smooth animations and navigations, everything feels fast. Because it is.
- One click away from accessing content (e.g. icon on the user’s phone).
- Re-engages with push notifications – We are using service workers so we have the ability to run a script in the background and send push notifications. Even when the browser is not visible to the user.
- Good experience on flaky network connections.
- Consistent experience across browsers
Here is a good list of PWA to show you by example.
Reminders
- From May 15th, Chrome will no longer support SPDY (and NPN) in favor of HTTP/2.
- The popularity of the proxy browsers and transcoding services is also an indicator that we—the site owners and web developers—are ignoring the high user demand for fast and light applications and pages. Let’s fix that. Learn how: https://developers.google.com/web/updates/2016/02/save-data
- Starting in July 2016, you’ll no longer be able to upload display ads built in Flash. And, starting in January 2017, AdWords will stop running display ads in the Flash format.
So it is a good time to update your flash ads to HTML5 ads.
Media Land
- Record audio and video with the MediaRecorder API: in Firefox and Chrome on Android and desktop.
- VP9 is now available for WebRTC: With VP9, internet connections that are currently able to serve 720p without packet loss or delay will be able to support a 1080p video call at the same bandwidth. VP9 can also reduce data usage for users with poor connections or expensive data plans, requiring in best cases only 40% of the bitrate of VP8.
- How often do people watch online videos via their smartphone?: from Google Barometer
Thanks for reading!
Accelerate your mobile pages, it’s easy!

In October, Google announced a new open source project called Accelerated Mobile Pages, which aims to dramatically improve the performance of the mobile web.
Why it is important?
Well, one look at the history of these posts will prove you that there is a real need for speed!
The project relies on AMP HTML, a new open framework built entirely out of existing web technologies, which allows websites to build light-weight web pages.
The basic ‘hello world’ version of your HTML page will look like: Continue reading



