Book Image

Mobile Web Performance Optimization

By : S. S. Niranga
Book Image

Mobile Web Performance Optimization

By: S. S. Niranga

Overview of this book

With users increasingly accessing the web on mobile devices, it’s crucial to make sure your website is built to seamlessly fit this radical change in user behavior. Mobile Web Performance Optimization is designed to help you do exactly that – it’s been created to help you build fast, and mobile-user-friendly websites and applications. Featuring guidance through a range of techniques and tools essential to modern mobile development, this accessible guide will make sure you’re delivering a seamless and intuitive experience for your website’s users. Begin by exploring the fundamental components of mobile web design and website optimization, before learning how to put the concepts into practice. Featuring cross-platform solutions, insights on developing lightweight yet robust UI, and insights on how to successfully manage data, this application development book takes you through every stage in the development process – so you can be confident that you’re asking the right questions and using the best tools in the most effective way. By the end, you’ll understand implicitly what it means to ‘build for performance’- you’ll be a more confident developer, capable of building projects that adapt to a changing world.
Table of Contents (14 chapters)
Mobile Web Performance Optimization
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Empty source and link attributes


If we have an HTML tag containing an attribute, without value, we say it is an empty attribute. The issue with this empty attribute is, if the empty attribute is a source or a link, some browsers will still try to connect to the server, even we set it as an empty value. This unwanted request and overhead will create delays in our mobile website or application. As an example, take a look at the following anchor tag and image tag:

<a href="">
<img src="">

Also, take a look at the following JavaScript code:

var image = new Image();
image.src = ""

Usually, the HTML recommendation is that if there is an src attribute, it should contain a URL. However, if you are using HTML5, you can have an empty attribute because, HTML5 uses specified algorithm to avoid extra requests if there is an empty attribute.

But, if you are not using HTML5 different browsers will behave differently:

  • Some browsers make the request to the same page

  • Some browsers ignore the request...