Solved

request to iss from jquery

Posted on 2014-09-03
5
186 Views
Last Modified: 2014-09-04
I have page which has a grid section.
User can select one record from it and its details loads up in the details section

Now under details section information comes from three tables.
I am using Jquery ajax method to load the information in the form of json.

my question is, as I need information from three tables then
1. should I make one request and get the big bulky object in return.
2. should I make multiple request and get multiple response but smaller in sizes.
0
Comment
Question by:yadavdep
  • 2
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 250 total points
ID: 40301016
Save server bandwidth and resoruces doing one request

{
    table1: [results request 1]
    table2: [results request 2]
    table3: [results request 3]
}

Open in new window

0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 250 total points
ID: 40301045
Depends on the size and type of the individual responses.

If the response size is relatively small (less than 100 KB) in total and response time is less than 10 sec, then one response is best.

However, if three individual queries on database you have fired are heavy/slow then it makes sense to call them one by one. You can show waiting indicator to manage the user experience or ensure that it is not too bad.
0
 

Author Comment

by:yadavdep
ID: 40302922
my problem is that in one of the table I have memo field and user can copy and paste any amount of data in it.
So the request size can vary.

but I also think doing a separate request would be better
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 40303212
<<my problem is that in one of the table I have memo field and user can copy and paste any amount of data in it.>>
In that case, unless you can stream data from your server, don't fetch everything in one go.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40303257
separate requests :
- slow dow, the proces
- consume bandwith
- slow down server (more request)

if you want to increase user experience choose another method
choosing a solution because it's easiest is not a right choice IMHO
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question