Maximizing the First-Visit Experience ASP.NET

The most challenging part of a web portal is the first-visit experience.On first visit, a new user gets a page that is set up with predefined widgets that are ready for furthe customization (see Figure).

The first visit to a web portal requires setting up the user account,creating pages, and populating with predefined widgets that user can further customize

The first visit to a web portal requires setting up the user account,creating pages, and populating with predefined widgets that user can further customize

During a first-time visit,the page does the following before the user sees it:

• Creates a new user account using a ASP.NET 2.0 membership provider

• Creates a new profile using a ASP.NET 2.0 profile provider

• Creates new pages for the user

• Creates default widgets on the first page

• Sets up widgets with default data, e.g., shows the weather in the user’s city by inferring the user’s location based on the IP address

• Renders the widgets and any associated client script

• Delivers the entire client framework to support the web portal functionality

The challenge here is to execute server-side tasks instantly so the server does not have a noticeable delay before it starts to deliver the page content to the browser.Once the response is delivered, the browser needs to download the Ajax framework,widget scripts, graphics, CSS, etc., which takes a long time.To give the user perceived fast speed, the server needs to deliver the content almost instantly and progressively download the rest while the user is looking at the content of the page.

Basically, during the first visit, the application needs to deliver almost every aspect of the web portal, because you don’t know what user might do once the page becomes functional.With Dropthings, users can use all the features of the application on the first visit.For example, a user can drag widgets, add new pages, and organize the content in pages, and then sign up to continue using the customized page. The user does all of this from a single web page with absolutely zero postback and no navigation to other pages.If postback was allowed on the page or the page was broken into multiple pages,then we could deliver only basic content and client-side features, like drag and drop.The rest of the functionality would be delivered when the user does Because postback or navigation to other pages is not allowed, if the entire client framework is not ready by the time the user starts interacting with the page, there will be JavaScript errors and actions will fail.

At the same time, you need to ensure that providing all these features on the first visit does not slow down first-time loading of the page. Otherwise, the first visit experience will be slow and the user will lose interest in the site.It’s a big challenge to make the first visit as fast as possible for the user so she can use the site immediately without getting bored looking at the browser progress bar.

The following are some ideas on how you can avoid a slow first-visit experience:

• Send HTML of the page and scripts in parallel so that the user sees something is happening on the page while the scripts and pictures download in the background. This increases the site’s perceived speed.

• Download the scripts in multiple steps. First, download the core Ajax runtime and then render the UI. This way, the user sees that something is happening and does not become impatient.

• Start downloading the other scripts that add additional features once the widgets are rendered on the UI.For example, extenders can download after the content is rendered.

• Delay downloading scripts that aren’t immediately necessarily and download those at a later stage.Generally,users don’t use features like drag and drop right away, which allows you to delay scripts for dialog boxes, tool tips, and animations.

• Combine multiple small scripts in one large script file. You could create one JavaScript file for each particular functionality.For example, each ASP.NET extender has one or more JavaScript files.Try to keep JavaScript files small and introduce many small files in the web applications.

The browser takes about 200 to 400 ms to reach the server and come back to the browser to download a file. So, each script file can waste 200 to 400 ms, and if there are five scripts, then the application spends one second on each network roundtrip. Now, add the total download time for the files, and it could easily take 10 seconds for 5 large scripts. So, you need to seriously think about (and test) how to optimize script file size and reduce network roundtrips as much as possible.

Ideally, you should Script files that are essential for the web portal to be fully functional on first visit.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

ASP.NET Topics