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 8529775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:06:23+00:00 2026-06-11T09:06:23+00:00

I have a wordpress site with an ajax search field that returns a list

  • 0

I have a wordpress site with an ajax search field that returns a list of posts, with just the title, the url, the date and the category.

I want to paginate the results so that max 10 results are shown every time.

My doubt is: is it good to make a different request every turn the page is turned or make only one request to fetch all the posts and then manage the pagination via javascript (the response is i JSON)?

Is it better to make more frequent small request with a light response or a big one?

I suppose that at the beginning of the site life the first solution is the best one. I’m not sure about scalability as the site grows.

What do you think?

UPDATE: I received a couple of very good answer, there were addressing more the user interface side of the problem.

Hwr I would like you to focus more on the performance point of view. My site is on a shared server but we expect traffic to go up fast, since the site will receive international exposure.
My fear is that wordpress will not be able to cope with the increased overhead that comes from the ajax requests.

So going back to the question, what would it better for the server total load, many small requests, loading only the requested result page or a big one with all the results?

Considering that not all the user i suppose are going to check all of the results pages i suppose the first…

  • 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-06-11T09:06:24+00:00Added an answer on June 11, 2026 at 9:06 am

    The correct answer is: “It depends”.

    If you were dealing with known quantities (10 results per page, 10 pages of results), and you wanted all of them to be made available to the user, asap, then I’d suggest downloading chunks (10 or 20) on a 500ms timer or something similar.

    Then you can fill up the extra back-pages asynchronously, and update the “total-pages” controls accordingly.

    From there, your user has immediate results, and has the ability to flip back and forth between all of your data in 2-ish seconds.

    If you had a site where you needed all of your data accessible right away, and you had 40 results that needed to be shown, then go with a big dump.

    If you had an infinite-scroll site, then you’d want to grab a couple of page-lengths. For something like Twitter, I’d probably pre-calculate the average height of the container, versus the screen height. Then I’d download 3 or 4 screen-lengths worth of tweets.
    From there, when the user was scrolling into their 2nd or 3rd screen (or 3rd or 4th respectively), I’d download the next batch.

    So my event might be attached to an onscroll, which checks if it’s allowed to run (if it’s been at least 16ms since the last time it’s run, — obviously, we’re still scrolling), then it will check where it is, in terms of how close it is to the bottom, considering screen-height, and the total height of the last batch (screen_bottom >= latest_batch.height * 0.75) or similar. The screen_bottom would be relative to the last_batch, in that if the user was scrolling back up, higher than the previous batch, screen_bottom would be a negative number, completely.

    …or normalize them, so that you’re just dealing with percentages.

    It’s enough to make it feel like the data is always there for you.
    You don’t want to have to wait for a huge block to load at the start, but you don’t want to wait for tiny blocks to load, while you’re trying to move around, either.

    So figure out what the happy medium is, based on what you’re doing, and how you expect the user to use your data.

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

Sidebar

Related Questions

i have a wordpress site that currently shows the posts like http://mysite.com/index.php?p=1 and now
I have a ajax login widget on a wordpress site thing is only me
I have a wordpress site that I only want to allow people to post
I have developed a Wordpress site that loads pages dynamically using the .load function.
I have a wordpress site that i've been working on that has some pages
I have a wordpress site at http://myname.myprovider.info and I just bought the domain http://www.myname.com
I have a Wordpress site that uses two databases -- one section queries one
Alright, I have a wordpress site, that I want to have a clientportal built
i have a wordpress site that when a form is filled out, if an
I have a Wordpress site that I am currently working on and have set

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.