Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best practices for minimizing download time for data-rich pages?

Status
Not open for further replies.

webdevrTX

Programmer
Apr 12, 2009
5
US
I just got our of a job interview as a CSS developer for a major telecom company to combine all their logged-in services into one portal, and the question I got hit with is "What do you do to minimize the number calls to the server for pages with large amounts of server-driven data and media?"

I'm a front-end developer. I answered about image preloading and httpRequests. I was getting a little over my head there. (I thought the interview was going to be about CSS.) Then they asked, "OK, image preloading still makes calls to the server, so what else could you do?" I was stumped. I said I will research that question. I have a suspicion that some aspects of AJAX may be involved, but I am not an AJAX developer. Am I on the right track? Any ideas?
 
I'm a front-end developer.

I am not an AJAX developer

AJAX [!]is[/!] front-end - it's just JavaScript that calls whatever server-side service it needs to. A lot of front-end roles now require AJAX experience, so you might want to start playing around with it - it's not hard once you get your head around the concept that ultimately, it's no different from a form submission or regular HTTP page request.

On the question you pose, one thing you need to remember is that AJAX still makes calls to the server - it can't just magic up data from nowhere, so using AJAX won't necessarily reduce the amount of data coming back from the server than not using AJAX.

I guess the key word there is necessarily. You can still write bad AJAX code that brings back as much data as delivering it to the page in the first place, but using AJAX makes it easier to write code that brings back only what is necessary. Take this example:

You have 10,000 names in a drop-down list, lets say each name is exactly 15 characters. If you were to deliver all of those names to the pages on initial load, that would be a minimum of 150,000 bytes - or 150Kb.

If you wrote a custom control that only bought back names after the user entered the first one or two letters of the name, you could cut that down dramatically. For example, if only 100 names began with the letter J, you would only need to download 1.5Kb of data.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Curious interview: looks like they want a free consulting service. I hate those ones: I get paid for answering this, interviews are just to check I'm a smart guy. My answer would be "Hire me and you will see"

Anyway, I agree Dan's point: there's no magic in Ajax, so I'd tell them that the important thinkg is user experience, so if you first load some media the user is waiting for, he will be busy for a while and you will have time enough to load the rest of the contents

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top