Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7058943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:10:23+00:00 2026-05-28T04:10:23+00:00

I have a page which has three components: suggested items, suggested people, and a

  • 0

I have a page which has three components: suggested items, suggested people, and a post feed. When a GET request is issues on this page, I have two options:

1) In the controller/action for the page, I can fetch the suggested items, suggested people, and the posts making up the feed and then display the page with all the data at once.


2) In the controller/action for the page, I don’t do much. I can use ajax on the page to make three independent requests to a controller/action for suggested items, a controller/action for suggested people, and a controller/action for the post feed and let their js.erb files populate the page with the fetched content.

First of all, is option (2) even possible? If so, it seems as if it is more modular since I can reuse that logic for other pages which also need to display suggested items, suggested people, etc… This is obviously at the cost of making more requests.

Which method is recommended? Pros/cons?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:10:23+00:00Added an answer on May 28, 2026 at 4:10 am

    Well Any day I would suggest having a single call instead of 3 separate calls. As you mentioned you have a cost of making three different requests also the other reason for the same is the restriction on the number of concurrent connections to a domain on certain browsers (2 for IE7). Also think about your webserver and the maximum requests it can handle as the number of users increase.

    Also you can still make it modular by having all the three actions and have an action that will call these three actions and aggregate the results if that is even possible as I am not too sure about the Rails architecture.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which has a tree directory of people who work at
I have a page which has document.body.onload=function(){...} but this is suffering delays because the
This may sound a weird question, I have a page which has a link:
I have a web page which has three <div> elements: Right_bar contains several layouts
I have one ListBox which has three Items in it. And also has one
I have a page which has an Iframe. In that Iframe, there are six
I have a page which has an Html.DropDownList which takes in a viewdata parameter.
I have a page which has several <canvas> elements. I am passing the canvas
I have a page which has many event handlers. The code now reached 1000+
I have a page which has radio buttons and the selected value is taken

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.