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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:28:47+00:00 2026-05-14T06:28:47+00:00

I have a web page that displays dynamic data which changes every 2 seconds.

  • 0

I have a web page that displays dynamic data which changes every 2 seconds. Data is selected from various data sources including Oracle. Currently, the page reloads every 10 seconds and runs a PHP script which retrieves the data and displays the page. I have other pages that gives a different view on the same data. This means the same query is run again for them as well. If I have 4 of these pages with 10 concurrent users each, suddenly the data retrieval happens 40 times every 10 seconds, obviously not ideal. I have some ideas on how to improve this situation, but I thought I would ask from some ideas from other experts that might have come across a similar situation. I’m not bound to PHP, and my server is on a Linux platform.

Regards

Marius

  • 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-14T06:28:47+00:00Added an answer on May 14, 2026 at 6:28 am

    I had a similar problem in a recent project and opted to cache all the retrieved database data using a Memcached daemon. So instead of querying the database 40 times you will query it once and then subsequently simply open a TCP/IP connection to the memcached daemon to fetch the cached result data. Note that PHP has a memcached extension which is quite easy to understand and use.

    If the page you display to the user must update its data every 2 seconds or so then it might be best to reload the data via AJAX instead of loading the HTML, CSS and Javascript every time the page gets refreshed. Taha above mentioned using a Comet server to simulate ‘pushing’ the data from the server to the client. You can easily roll your own. From my understanding the two main techniques that will work with all major browsers are:

    • AJAX long-polling, where the AJAX request only completes once new data is available to show (this is the method I ended up using).
    • Loading a never-ending page in an IFRAME.

    An excellent tutorial for using the above two techniques is availabe here. The author also provides their code for download.

    Although I used Apache + PHP to implement my Comet solution, it might be better to switch to a non-blocking framework such as Tornado (Python).

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

Sidebar

Ask A Question

Stats

  • Questions 483k
  • Answers 484k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It will only display the request headers you've set yourself.… May 16, 2026 at 7:15 am
  • Editorial Team
    Editorial Team added an answer If those are the only 3 classes, and you're certain… May 16, 2026 at 7:15 am
  • Editorial Team
    Editorial Team added an answer The scoped nature of use is a documented feature: use… May 16, 2026 at 7:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.