Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mobile Web Performance Optimization

You're reading from   Mobile Web Performance Optimization Deliver a better mobile user experience by improving and optimizing your website – follow these practical steps for cutting-edge application development

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785289972
Length 150 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
S. S. Niranga S. S. Niranga
Author Profile Icon S. S. Niranga
S. S. Niranga
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Pillars of Mobile Web Performance Optimization 2. Mobile Web Optimization Essentials FREE CHAPTER 3. How to Optimize Your Mobile Website 4. Caching and Optimizing 5. Monitoring and Debugging Our Website 6. Managing Third-Party Components 7. Tips and Tricks Index

Performing actions optimistically


If one of your visitors on your website decided to leave a comment, they would click on a button that submits the form. When they do that, two actions take place. The form, using AJAX, sends a request to the server, and a loading graphic appears to notify the user that their submission is in the process. When the script hears back from the server that the task has been completed successfully, it updates the page alerting the visitor.

This is the way it's usually done, but maybe it's not the best way. This request, particularly on a high-latency network, can take several hundred milliseconds, which is a very noticeable delay for the person trying to submit their comment.

Instagram has taken a different approach to avoid that delay. As soon as the person submits the comment, it appears on the page. The request happens in the background. To the person submitting the comment, it looks like it happens instantaneously. In reality, it takes as long to process as...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image