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

  • Home
  • SEARCH
  • 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 8014499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:57:12+00:00 2026-06-04T19:57:12+00:00

I am trying to use AJAX to read when a file or database has

  • 0

I am trying to use AJAX to read when a file or database has changed (had an extra post added to it by another user), and display the newest post (kind of like SO)

And it worked, but the thing is the host I’m using only allows a certain amount of “resource usage per hour” and once the limit is hit, the site is locked out for an hour. This is a free host I’m mainly using for testing and learning.

So before, I had the AJAX set to a setInterval of checking every 2-4 seconds, from a file that was just echoing the last post made in the system. Which I’m guessing is what shut down the site for an hour in a matter of minutes.

So I’m wondering if there’s anyway to make it only retrieve the newest post ONLY when the result has changed from what it last found. It sounds like that can’t be done because it’d still have to check every time, activating the PHP, regardless of what sends back.

Any ideas how I can do this or something similar?

  • 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-04T19:57:13+00:00Added an answer on June 4, 2026 at 7:57 pm

    You could use http://en.wikipedia.org/wiki/WebSocket (but I guess not on your host, since there is a apache extension you have to install) or you use http://en.wikipedia.org/wiki/Push_technology#Long_polling.

    With long polling you send one request to your PHP and the PHP script loops until a new post was found and then send the response.

    But you really should consider changing the hoster, because realtime web application need moe ressources. Why not testing and learning locally on your machine?

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

Sidebar

Related Questions

I'm trying to use ajax file upload plugin( file uploader plugin ) to upload
I am trying to use .ajax() to post a People object to a MVC2
I'm trying to use jquery.Ajax to post data to an ASP.NET MVC2 action method
I'm trying to read the http-response by ajax request. As an echo-server I use
I am trying to use Valum's Ajax Upload to do file uploads on a
I am currently trying to use AJAX in my application via jRails. I am
I am trying to use some ajax and the jQuery Masonry plugin to add
I am trying to use periodic refresh(ajax)/polling on my site by XMLHttp(XHR) to check
I am trying to use the Bing Maps Ajax Control to plot pins of
I am trying to make use of jQueryUI AJAX tabs in my ASP.Net Webforms

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.