When was the last time you opened a page on a website and tried to click on something multiple times for it to work? Or the last time you swiped on an

Building a Faster Web Experience with the postTask Scheduler

submited by
Style Pass
2021-05-21 04:00:02

When was the last time you opened a page on a website and tried to click on something multiple times for it to work? Or the last time you swiped on an image in a carousel and it stuttered and shifted around unnaturally?

While this type of experience happens far too often, we can use tools that can help us make better, more responsive experiences for users. Scheduling and prioritizing tasks efficiently can be the difference between a responsive experience and one that feels sluggish.

At Airbnb, we’ve been collaborating with the Chrome team on improving performance using a prioritized task scheduler to implement new patterns and improve the performance of existing ones.

The prioritized postTask API is designed to give us more flexibility and power around scheduling tasks efficiently. Similar to requestIdleCallback and setTimeout, using it effectively can help reduce Total Blocking Time, First Contentful Paint, Input Delays and other key metrics.

While many performance efforts focus on the initial page load, we wanted to improve the user experience after the page has loaded. We used the postTask scheduler in a number of way — from how we preload images in carousels to making our map more responsive.

Leave a Comment