Monthly Archives: November 2014

HP offers a video preview of its smartwatch

Hpsmrtwtch1
Feed-fb

When Hewlett-Packard (HP) and the Gilt Groupe unveiled their MB Chronowing smartwatch last week, all we had to gauge the functionality of the device were photos. Now the companies have offered a video that shows the device in action

Posted to Gilt's Vimeo account on Monday, the video (see below) is hosted by fashion designer Michael Bastian, who worked with HP to create what the group considers a more fashion-friendly device than rival smartwatch offerings.



Despite the fact that the device doesn't have a touchscreen like the ...

More about Fashion, Hp, Hewlett Packard, Wearables, and Gilt Groupe

By |November 4th, 2014|Apps and Software|0 Comments

Enabling http Without Sacrificing Your Web Performance

7557181168_91f4af2d99_z

Posted by Zoompf

A fast website is a crucial component of a great user experience. So much so that a few years ago Google announced that they were using page load time as a factor in search engine rankings. More recently, Google also announced that they would be favoring websites that use Transport Layer Security (TLS) in its search rankings. TLS encrypts a website's traffic preventing other entities from monitoring its communications. However, adding this protection introduces more complexity to your website and how it communicates with your visitors, potentially slowing things down and negatively affecting the user experience. In this blog post, I will show you how to implement TLS on your website while keeping it fast and responsive.

Conventions and disclaimers

Before we start, a quick note on naming. Beside TLS, you may have also heard the term SSL. SSL was the original encrypted connection protocol created by Netscape in the mid '90s. TLS is the industry standard protocol that grew out of SSL and has continued to evolve and improve while development of SSL has ceased. In the past, SSL and TLS have been largely interchangeable terms. However, the final version of SSL, SSLv3, was recently found to be not secure. All versions of SSL now have known security problems and no one should be using any version of SSL. To avoid confusion, we will not mention SSL again, and will talk exclusively about TLS.

Additionally, while TLS does help protect your websites's visitors from eavesdroppers, it does not magically make your site "secure" from security flaws like cross-site scripting or SQL injection. If you store personal data or conduct commerce through your website, you should explore more rigorous web application security options.

Finally, any type of guide, tutorial, or how-to post on security is highly time sensitive. Attackers are constantly evolving and new attacks are always discovered. Advice about optimizing TLS performance from even 2 years ago, such as using RC4, would today leave your site unsecured. You should always maintain vigilance and make sure you trust your sources.

TLS Areas that need TLC

There are 2 areas of TLS that can harbor performance problems:

  1. Encrypting the data. Data sent back and forth between visiting web browsers and your web server must be encrypted and decrypted. If not configured properly, your page load times can become much slower than unencrypted traffic.
  2. Establishing a secure connection. There are several steps that must occur before a browser establishes a secured connection to your website: identities must be confirmed, algorithms must be selected, and keys must be exchanged. This is known as the TLS Handshake, and it can have a significant impact on your site performance.

We need to give each of these areas some Tender Loving Care (TLC) to optimize for performance. Let's discuss each in detail.

Optimizing Data Encryption

When you use TLS, you are adding another 2 steps to the process of how a browser and web server communicate. The sender has to work to encrypt the data before transmitting it, and the receiver has to decrypt the data before it can process it. Since these operations are occurring on all of your web traffic all of the time, you want this exchange to be as efficient as possible.

There are a large number of ciphers that can be used to perform this encryption/decryption. Some, such as 3DES, were originally designed to be implemented in hardware and can perform slowly when implemented in software on your computer or phone's browser. Others, such as AES, are so popular that CPU makers like Intel have added dedicated instructions to their chips to make them run faster.

A decade ago, TLS data encryption added significant overhead. Today, Moore's law and dedicated support for certain ciphers in CPUs has essentially eliminated this overhead, provided you select the right cipher. The consensus from both security engineers and administrators that run large TLS websites is to use AES, with 128 bit keys. We can see from the chart below that AES running on a CPU that supports built-in AES instructions (denoted by the label AES-NI) is by far the fastest cipher you can use.

Specifying which cipher and options to use can be quite challenging and intimidating. Luckily, Mozilla maintains an excellent page with example cipher configurations to ensure fast and secure connections. These example configurations work with all browsers, and they default to using the faster algorithms like AES. These are constantly updated when new security threats come out, and I highly suggest following their guidance.

As mentioned, to get the most out of AES, your web server will need to use a CPU that supports the dedicated AES instructions known as AES-NI. Most server-grade CPUs made in the last 5 years, such as Intel's Xeon line, support AES-NI. However, older virtualized servers and cloud servers often don't support these instructions. Amazon's M1 class of EC2 instances does not support AES-NI, whereas Amazon's current class of M3 instances do. If you are using a hosted service, check with your hosting provider about what TLS options they support and whether your hosting computer supports AES-NI.

In short, by configuring your web server to use AES ciphers and terminating your TLS connections on a machine with CPU with support for AES-NI instructions, you can effectively mitigate the performance penalty of data encryption.

Optimization Checklist

  • Enable AES as your preferred cipher, following Mozilla's guidelines.
  • Verify that web server is running on a system with a CPU that supports AES-NI instructions.

Optimizing the TLS Handshake

The TLS handshake is the process that the browser and server follow to decide how to communicate and create the secured connection. Some of the things that happen during the handshake are:

  • Confirming the identity of the server, and possibly the client
  • Telling each other what ciphers, signatures, and other options each party supports, and agreeing on which to use
  • Creating and exchanging keys to be used later during data encryption

The TLS handshake is shown in this rather technical-looking diagram:

handshake

Don't worry. While there are a lot of details in the diagram, the takeaway is that a full TLS handshake involves 2 round trips between the client and the server. Because of the difference between latency and bandwidth, a faster internet connection doesn't make these round trips any faster. This handshake will typically take between 250 milliseconds to half a second, but it can take longer.

At first, a half-second might not sound like a lot of time. The primary performance problem with the TLS handshake is not how long it takes, it is when the handshake happens. Since TLS handshakes are part of creating the secure connection, they have to happen before any data can be exchanged. Look at the waterfall diagram below: (if you need help, check out how to read a webpage waterfall chart.)

TLS head of line

The TLS handshake, shown in purple for each step here, is adding 750 ms of delay to the time it takes to get the initial HTML page. In this example, getting the HTML page over TLS takes twice as long as getting the same page over an unencrypted connection! Worse, the browser can't do anything else until it gets this initial HTML page. It cannot be downloading other resources in parallel, like CSS files or images, because it hasn't gotten that initial HTML page telling them about the other resources. This is true with every secured webpage you visit: The browser is blocked from getting that first HTML response. Unfortunately, the TLS handshake increases the amount of time where the browser can't do anything, slowing down your site performance.

Also, remember the TLS handshakes happen at the start of every new HTTP connection. Since browsers download resources in parallel, this means that a visiting browser will create multiple TLS connections and have to wait for multiple handshakes to complete, even with visiting a single page!

Unfortunately, there is not a lot of extra or unnecessary data that we can optimize during the TLS handshake. The primary aspect we can optimize is the "confirming the identity of the server" step. To do this, the browser looks at something called the certificate chain.

The certificate chain

When you visit http://www.example.com, how do you know you are really talking to www.example.com? TLS certificates solve this problem. You receive a certificate telling your browser "yes, this is www.example.com. trust me." But how do you know you can trust the certificate the server sent?

This is where the certificate chain comes in. Your certificate will be digitally signed by some other entity's certificate, which essentially says "example.com is cool, I vouch for it, here is my certificate." This is called an intermediate certificate. Browsers come with a built in a list of a thousand or so certificates that they trust. If the browser happens to trust this intermediate certificate, we are done. However, it's possible the browser doesn't trust your website's certificate, or the intermediate certificate.

What happens then? Simple! The browser will then look to see who signed the intermediate certificate, and who signed that one, and so on... Basically the browser will "walk" up this chain of certificates, seeing who is vouching for who, until it finds a certificate of someone it trusts from that built-in list mentioned above.

The certificate chain looks something like this:

cert-chain-app.zoompf.com

Here we see a certificate for my website app.zoompf.com. My certificate was signed by the certificate by "DigiCert Secure Server CA." The browser does not trust this certificate since it's not in its pre-built list. However, the "DigiCert Secure Server CA" certificate was in turn signed by the "DigiCert Global Root CA" certificate, which is in that list and is thus trusted. So in this case, my certificate chain length is 3.

You can optimize your site performance by making this certificate chain as short as possible, since validating each certificate in the chain takes extra time. Additional certificates also means more data that has to be exchanged while establishing the secured connection. The browser might even need to make additional requests to download other immediate certificates, or to check that each certificate in the chain is still valid and hasn't been revoked.

When shopping for an TLS certificate, ask the vendor:

  • What certificate will be used to sign your certificate, and how long will the certificate chain be?
  • Will they include their intermediate certificate bundled with your certificate, so the browser won't have to wait downloading other certificates while walking up the certificate chain?
  • Do they support OCSP stapling, to reduce the time needed to check for revoked certificates?

I recommend purchasing your certificate from a large, well known vendor. These tend to offer better support and features like OCSP. They are also more likely to have their root certificates trusted by the browser and thus have a shorter certificate chain length. You can learn more about how to test your certificate chain here.

Optimization checklist

  1. Minimize the length of your certificate chain.
  2. Verify that any immediate certificates are bundled with your certificate.
  3. Get a certificate that supports OCSP, if possible.

Avoiding full TLS handshakes

At its heart, the TLS handshake is about the client and the server verifying each other, agreeing on a common set of ciphers and security options, and then continuing the conversation using those options. It seems silly that a client and a server that have recently communicated before need to go through this full process over and over again. Imagine this scenario: You are visiting a blog like this one over TLS. Multiple TLS connections with multiple handshakes were made to download all the content. In a few minutes, you click a link to read a different page on this site, which causes your browser to do multiple TLS handshakes all over again.

This is where TLS session resumption comes in. Basically, TLS session resumption allows a client to say, "Hey server, we communicated a little while ago and did so using the following TLS options... Is it OK to start talking again using those same options?" This is a huge improvement on performance. A full TLS handshake requires 2 round trips to create the secure connection. TLS session resumptions allows us to do it with 1 round trip.

The great thing about session resumption is that it is basically a free short-cut. When the client asks the server, "can we use these previously agreed upon settings?", it does so as part of the first round trip in setting up a full TLS handshake. If the server agrees, great, the short cut is followed and no further handshaking is necessary. If, for whatever reason, the server doesn't agree to the session resumption request, the TLS handshake continues as normal and completes in 2 round trips. There's no reason not to use session resumption.

There are 2 different mechanisms to implement TLS resumption. The first is Session Identifiers and the second is Session Tickets. They both do the same thing. The difference between them is primarily which side has to keep track of the previously agreed upon options. All web browsers support both, but some web servers, like Microsoft's IIS, only support session identifiers. Session identifiers are a slightly older mechanism, and can potentially expose your site to Denial of Service attacks. Enabling either session identifiers or sessions tickets is done via your web server configuration, and is quite easy. Consult with your administrator about getting these options enabled.

Optimization checklist

  1. Enable TLS resumption on your web servers.
  2. If possible, avoid using session identifiers to reduce your exposure to Denial of Service attacks.

Other TLS Options

There are several other TLS options and nuances we are glossing over: What asymmetric algorithm should you use? What key exchange protocol should you use? What key size should you use for your symmetric cipher? Should you be using perfect forward secrecy? These are important decisions from a security perspective, and everyone's needs are different. From a performance perspective, these are largely moot. It is best to leave these choices to whomever manages your server, or to follow advice from Mozilla on the page linked above.

Minimizing TLS handshakes altogether

As we have seen, the TLS handshakes, while necessary, can have an impact on your performance:

  • They can delay the download of critical responses like the initial HTML page.
  • They can happen multiple times on a single page.
  • There isn't much we can do to optimize them.

While session resumption can cut the delay of a TLS handshake in half, it is still best to avoid TLS handshakes altogether. You can do this by minimizing how many HTTP connections a browser makes when visiting your website. Luckily, many traditional front-end performance optimizations that you should be doing anyway can help. This makes front-end performance optimizations even more important on sites secured with TLS. Let's focus on 4 optimizations that are particularly relevant for sites using TLS.

1. Persistent connections

Persistent connections allow HTTP to make multiple requests over a single HTTP connection. Persistent connections allow the browser to load the page faster because it can make requests more quickly. But it can also cut down on the number of TLS handshakes. Consider this waterfall, which we looked at before:

TLS head of line

See how virtually every HTTP request has a purple section? This purple section is the TLS handshake. Why does it keep happening? Because the web server is explicitly closing the HTTP connection, and thus the underlying TLS connection, with every response. We can see this with the Connection: close response header, as shown below:

ssl-connection-close

This is terrible for performance in general, but especially bad for a site using TLS. Your website should be using persistent connections.

2. Domain sharding

Domain sharding is a technique to trick a visiting browser into downloading resources from your website more quickly. It works by having a single web server with different hostnames. For example, your site might be named example.com, but configured to resolve the names static1.example.com and static2.example.com to the same server. Since browsers allow only a limited number of HTTP connections to a single hostname at the same time, using multiple hostnames trick the browser into downloading more content in parallel.

The problem with domain sharding is that the browser doesn't know that example.com, static1.example.com, and static2.example.com are all the same server. It will make new HTTP connections to each hostname, and have to do a full TLS handshake each time. In our example, we are potentially doing 3 times the number of TLS handshakes because of our sharded hostnames. Additionally, session resumption information for connections on one hostname cannot be used by connections to another hostname, even though under the covers all these names refer to the same server.

The net result is that increased number of TLS handshakes caused by domain sharding may offset any advantage gained from downloading more content in parallel. In fact, sharding a TLS-protected website might actually make it slower. This is especially true if you follow the next two pieces of advice, which will reduce the number of items that need to be requested at all.

3. Combining CSS and JavaScript files

Combining multiple CSS or JavaScript files into one or two primary files is a huge front-end performance optimization. Browsers can download one 100 KB file faster than 10 10-KB files. The advantage for TLS sites is that if you are making fewer requests, you are less likely to need additional HTTP connections that will require a resumed or full TLS handshake.

4. Caching resources

The fastest request is one the browser doesn't have to make. Caching might be the best front-end performance optimization you can make. If I just visited your site, and I'm looking at a second page, there is no reason to download your logo a second time. If you don't use caching, the browser must check with your website if it is OK to use logo image it has previously downloaded. This is called a conditional request, and it's bad for performance. Because of the difference between bandwidth and latency, even if you don't actually download anything from the server, simple sending a request to ask if it is OK to use a logo takes almost as long as just downloading the logo again.

Conditional requests are bad for TLS. You are forcing the browser to create more HTTP connections, and thus perform more TLS handshakes, just to check if the content is still valid. Caching your static resources like images, CSS and JavaScript will have a big benefit and can prevent these additional connections.

Optimization checklist

  • Enable persistent connections. Ensure your application or CMS is not prematurely closing HTTP connections.
  • Use tools like WebPageTest to see if domain sharding will actually improve performance for your TLS enabled website.
  • Combine multiple JavaScrpt and CSS files into bundles where appropriate.
  • Cache your static resources for 5 minutes, even if you don't have a file versioning system in place.
  • If you have the infrastructure and processes in place, use far-future caching with a file versioning system that changes the URLs of your resources when they change.
  • Test your site to ensure you are properly implementing front-end performance optimizations.

Summary

Google is now favoring websites that are secured using TLS in search engine rankings. TLS can have an impact on performance and this article has shown you the steps you can take to minimize the impact.

The data encryption overhead for secure connections is largely a problem of the past, thanks to faster CPUs with built-in support for AES cipher operations. The TLS handshake can be optimized by keeping your certificate chain short by purchasing your certificate from a large, well known vendor whose signing certificates on the trusted list instead of web browser. You can speed up subsequent TLS handshakes by enabling session resumption on your server. You can avoid many TLS handshakes all together by implementing common front-end performance optimizations like persistent connections and caching, and avoiding tricks like domain sharding. You can also use Zoompf's free performance report to ensure your website is using AES and is properly implementing the suggested front-end performance optimizations.

In our next blog post we will discuss with intersection of security and performance that Google is creating with its new SPDY protocol.

If you'd like to stay on top of your website performance, consider joining the free Zoompf Alerts beta to automatically scan your website every day for the common causes of slow website performance.


Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don't have time to hunt down but want to read!

By |November 4th, 2014|MOZ|0 Comments

Google Calendar app tracks events, flights, dinner reservations in real time

Googlecalendar
Feed-fb

On the heels of Google's new Inbox app, the company rolled out on Monday a brand new Google Calendar app that cuts down on how much you have to manually enter event details.

The app — which is available today for devices running Android 5.0 Lollipop and will be downloadable for Android 4.1+ devices in the coming weeks — keeps tabs on the things you book. This means whenever you reserve flight, order concert tickets or a make a dinner or hotel reservations, the Calendar app will update with that information

Google Calendar

Image: Google ...

More about Google, Mobile, Apps, Android, and Tech

By |November 3rd, 2014|Apps and Software|0 Comments

Apple Watch coming in spring 2015, report says

Appwtch987
Feed-fb

When Tim Cook unveiled the Apple Watch in September, he teased an "early 2015" launch date. But a new statement uncovered on Sunday indicates that we may have to wait a little longer — try spring

The new time window comes via a report from 9to5Mac, which obtained a transcript of an internal Apple video statement from Angela Ahrendts, Apple's Senior Vice President of Retail and Online Stores, addressing the company's employees.

"We're going into the holiday, we'll go into Chinese New Year, and then we've got a new watch launch coming in the spring," reads ...

More about Apple, Wearables, Wearable Tech, Tech, and Apps Software

By |November 3rd, 2014|Apps and Software|0 Comments

Google’s Physical Web and its Impact on Search

Posted by Tom-Anthony

In early October, Google announced a new project called " The Physical Web," which they explain like this:

The Physical Web is an approach to unleash the core superpower of the web: interaction on demand. People should be able to walk up to any smart device - a vending machine, a poster, a toy, a bus stop, a rental car - and not have to download an app first. Everything should be just a tap away.

At the moment this is an experimental project which is designed to promote establishing an open standard by which this mechanism could work. The two key elements of this initiative are:

URLs: The project proposes that all 'smart devices' should advertise a URL by which you can interact with that device. The device broadcasts its URL to anyone in the vicinity, who can detect it via their smartphone (with the eventual goal being this functionality is built into the smart phone operating systems rather than needing third-party apps).

Beacons: Not well known until Apple recently jumped on the bandwagon announcing iBeacons, beacon technology has been around for a couple of years now. Using a streamlined sibling of Bluetooth, called Bluetooth Low Energy (no pairing, range of ~70 metres / ~230 feet) it allows smartphones to detect the presence of nearby beacons and their approximate distance. Until now they've mostly been used to 'hyper-local' location based applications (check this blog post of mine for some thoughts on how this might impact SEO).

The project proposes adapting and augmenting the signal that Beacons send out to include a URL by which nearby users might interact with a smart device.

This post is about looking to the future at ways this could potentially impact search. It isn't likely that any serious impact will happen within the next 18 months, and it is hard to predict exactly how things will pan out, but this post is designed to prompt you to think about things proactively.

Usage examples

To help wrap your head around this, lets look at a few examples of possible uses:

Bus times: This is one of the examples Google gives, where you walk up to a bus stop and on detecting the smart device embedded into the stop your phone allows you to pull the latest bus times and travel info.

Item finder: Imagine when you go to the store looking for a specific item. You could pull out your phone and check stock of the item, as well as being directed to the specific part of the store where you can find it.

Check in: Combined with using URLs that are only accessible on local wifi / intranet, you could make a flexible and consistent check in mechanism for people in a variety of situations.

I'm sure there are many many more applications that are yet to be thought up. One thing to notice is that there is no reason you can't bookmark these advertised URLs and use them elsewhere, so you can't be sure that someone accessing the URL is actually by the device in question. You can get some of the way there by using URLs that are only accessible within a certain network, but that isn't going to be a general solution.

Also, note that these URLs don't need to be constrained to just website URLs; they could just as well be deep links into apps which you might have installed.

Parallels to the web and ranking

There are some obvious parallels to the web (which is likely why Google named it the way they did). There will be many smart devices which will map to URLs which anyone can go to. A corollary of this is that there will be similar issues to those we see in search engines today. Google already identified one such issue—ranking—on the page for the project:

At first, the nearby smart devices will be small, but if we're successful, there will be many to choose from and that raises an important UX issue. This is where ranking comes in. Today, we are perfectly happy typing "tennis" into a search engine and getting millions of results back, we trust that the first 10 are the best ones. The same applies here. The phone agent can sort by both signal strength as well as personal preference and history, among many other possible factors. Clearly there is lots of work to be done here.

So there is immediately a parallel between with Google's role on the world wide web and their potential role on this new physical web; there is a suggestion here that someone needs to rank beacons if they become so numerous that our phones or wearable devices are often picking up a variety of beacons.

Google proposes proximity as the primary measure of ranking, but the proximity range of BLE technology is very imprecise, so I imagine in dense urban areas that just using proximity won't be sufficient. Furthermore, given the beacons are cheap (in bulk, $5 per piece will get you standalone beacons with a year-long battery) I imagine there could be "smart device spam."

At that point, you need some sort of ranking mechanism and that will inevitably lead to people trying to optimise (be it manipulative or a more white-hat approach).
However, I don't think that will be the sole impact on search. There are several other possible outcomes.

Further impacts on the search industry

1. Locating out-of-range smart devices

Imagine that these smart devices became fairly widespread and were constantly advertising information to anyone nearby with a smart devices. I imagine, in a similar vein to schema.org actions which provide a standard way for websites to describe what they enable someone to do ("affordances," for the academics), we could establish similar semantic standards for smart devices enabling them to advertise what services/goods they provide.

Now imagine you are looking for a specific product or service, which you want as quickly as possible (e.g "I need to pick up a charger for my phone," or "I need to charge my phone on the move"). You could imagine that Google or some other search engine will have mapped these smart devices. If the above section was about "ranking," then this is about "indexing."

You could even imagine they could keep track of what is in stock at each of these places, enabling "environment-aware" searches. How might this work? Users in the vicinity whose devices have picked up the beacons, and read their (standardised) list of services could then record this into Google's index. It sounds like a strange paradigm, but it is exactly how Google's app indexing methodology works.

2. Added context

Context is becoming increasingly important for all searches that we do. Beyond your search phrase, Google look at what device you are on, where you are, what you have recently searched for, who you know, and quite a bit more. It makes our search experiences significantly better, and we should expect that they are going to continue to try to refine their understanding of our context ever more.

It is not hard to see that knowing what beacons people are near adds various facets of context. It can help refine location even further, giving indications to the environment you are in, what you are doing, and even what you might be looking for.

3. Passive searches

I've spoken a little bit about passive searches before; this is when Google runs searches for you based entirely off your context with no explicit search. Google Now is currently the embodiment of this technology, but I expect we'll see it become more and more

I believe could even see see a more explicit element of this become a reality, with the rise of conversational search. Conversational search is already at a point where a search queries can have persistent aspects ("How old is Tom Cruise?", then "How tall is he?" - the pronoun 'he' refers back to previous search). I expect we'll see this expand more into multi-stage searches ("Sushi restaurant within 10 minutes of here.", and then "Just those with 4 stars or more").

So, I could easily imagine that these elements combine with "environment-aware" searches (whether they are powered in the fashion I described above or not) to enable multi-stage searches that result in explicit passive searches. For example, "nearby shops with iPhone 6 cables in stock," to which Google fails to find a suitable result ("there are no suitable shops nearby") and you might then answer "let me know when there is."

Wrap up

It seems certain that embedded smart devices of some sort are coming, and this project from Google looks like a strong candidate to establish a standard. With the rise of smart devices, whichever form they end up taking and standard they end up using, it is certain this is going to impact the way people interact with their environments and use their smart phones and wearables.

It is hard to believe this won't also have a heavy impact upon marketing and business. What remains less clear is the scale of impact that this will have on SEO. Hopefully this post has got your brain going a bit so as and industry, we can start to prepare ourselves for the rise of smart devices.

I'd love to hear in the comments what other ideas people have and how you guys think this stuff might affect us.


Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don't have time to hunt down but want to read!

By |November 3rd, 2014|MOZ|0 Comments