Stellar for occasions that don't come around often

Is it worth utilizing a Comet for events that do not require real-time updates, but can have a delay of around 1 minute? Examples could include:

  • updates on Twitter statuses
  • notifications on Facebook

While Comet is commonly used in chat applications (such as Facebook and GTalk chats), is it also employed by platforms like Twitter?

Alternatively, would AJAX-polling be sufficient for these types of updates? Here are a few reasons why it might suffice:

  • With a polling interval of 1 minute, the server is not overwhelmed with AJAX requests.
  • The scenario of "no new data" is less common compared to chat applications.
  • No server threads are tied up, allowing them to be shared among multiple clients. For example, a thread pool of 100 threads may be utilized by 200 clients instead of just 100 when using Comet. However, this may vary based on the technology being used - for Java, refer to this article for details on intelligent thread reuse)

(Note: In this context, "comet" refers to maintaining an open connection. Some may mistakenly consider AJAX-polling as comet as well, hence the clarification - ajax-polling != comet in the above question)

Answer №1

It appears that you have successfully addressed your own question :) Additionally, it is worth considering that by using this approach, you can avoid cluttering your DOM with numerous <script> tags as seen in other prolonged comet solutions.

Answer №2

This question presents a dilemma where everyone appears equally qualified to answer. Without knowing the specifics of what you are referring to, it's difficult to determine which choice is the better option.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Inject Angular 2 component into designated space

I am working on a website that requires a settings dialog to be loaded in a designated area upon clicking a button. The settings dialog is a component that retrieves data from REST endpoints. I am hesitant to simply insert the component and hide it as I ...

Is it possible to pass a parameter to a PHP controller using JavaScript without relying on jQuery or AJAX?

Is it possible to achieve the task at hand? That's the main question here. My goal is to extract data from a popup window and then, upon closing it, send this extracted content to a PHP controller for further processing. I'm facing conflicts wi ...

I am experiencing issues with the functionality of front-page.php on my WordPress website

Seeking guidance in addressing a web development issue: I have encountered a problem with a website that I am currently working on locally using WordPress. I added the following code to the header.php file: <link rel="stylesheet" type="text/css" href= ...

Guidelines on managing two sets of JSON data sent via AJAX to a PHP script

Embarking on my journey into the realm of JSON/AJAX for the first time. Essentially, I am tasked with sending 2 sets of data to a PHP file. One set will be saved in a MySQL table, while the other is utilized by the PHP script. My Javascript generates 2 s ...

Unleash the Power of Animating Your Active Tabs

Is there a way to create animated tabs that slide in when clicked? I've experimented with using transition code but haven't quite achieved the desired effect yet. This is what I currently have: [data-tab-info] { display: non ...

The drawing library (Google Maps) failed to load

I am looking to integrate drawing mode into Google Maps for my project. Below is the code snippet from my View: <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <me ...

Combining PHP JQuery Dialog with Datatables results in a sleek design loss

Recently, I encountered an issue with my code. I have a file called incident_view.php which pulls data from the database and displays it using Datatables. Everything was working fine until I tried to open this page in a JQuery dialog on another page called ...

Using Ajax in PHP to send POST parameters

Why isn't it working? The script is in the main file. $('#savedocx').submit(function(){ $.ajax({ type: "POST", url: "savedocx.php", data: {q:'1',b:'2'}, success: fu ...

Ways to avoid unintentional removal of contenteditable unordered lists in Internet Explorer 10

How can I create a contenteditable ul element on a webpage while avoiding the issue in Internet Explorer 10 where selecting all and deleting removes the ul element from the page? Is there a way to prevent this or detect when it happens in order to insert ...

How to apply class binding within a v-for loop in Vue.js

When using Vuejs3, I am currently iterating through an array of objects: <div v-for="ligne in lignes" :key="ligne.id" :class="{ 'border-b-2':isSelected }" :id="`ligne_${ligne.id}`" > ...

The most efficient and hygienic method for retrieving a value based on an observable

Looking at the structure of my code, I see that there are numerous Observables and ReplaySubjects. When trying to extract a value from one of these observables in the HTML template, what would be the most effective approach? In certain situations, parame ...

What methods are available to adjust the header color on various pages?

I have a solution that works for one location, but I need to add red color to multiple locations. How can I achieve this? import { useRouter } from "next/router"; function Header() { const router = useRouter(); return ( <> & ...

Jquery's mouseclick event selects an excessive number of elements

Is there a way to retrieve the ID of an element when it is clicked, only if it has one? I currently have this code set up to alert me with the element's ID: $("[id]").click(function(event) { event.preventDefault(); var id_name = $(this).attr ...

Using Vue.js to showcase real-time Pusher data in Laravel 5.4

I am currently working on developing a real-time chat application using vue.js, Pusher, and Laravel. I have successfully managed to receive information from Pusher, as I can view the JSON data in the console with the correct details. However, I am facing a ...

What is the best way to ensure that the state is updated only when the user begins typing in a text

I am currently working on a text editor-related code and my main focus is to update the state of the editor only when the user starts typing in the editor. The state should be updated under the following scenarios: 1. Update the state when the user begin ...

The menu is about to receive some custom styling

I have come across a webpage where I need to make some modifications, but I am unable to locate the script responsible for applying the inline style. This issue only seems to be occurring on the mobile version with the dropdown menu. <div class="is-dri ...

JavaScript plugin specifically designed to enable playback of media content, such as videos from

I am working on a spring-based project and I require the ability to play audio/video in various formats similar to YouTube. I am currently searching for a free JS plugin that would be the best fit for my needs. Any suggestions or recommendations would be ...

How can I utilize the value of a jQuery variable in PHP code?

I am just starting out in development and feeling a bit lost. I have created an HTML calendar and a users table in my database with columns for id, user_name, total_holiday, and holiday_used. So far, I have implemented CRUD functionality for the users wher ...

Customizing the width of the JQuery $ui.progressbar by overriding its properties

After spending some time, I successfully overrode the function that controls the width of the progress bar element in the jQuery UI widget version 1.12.1 from September 14, 2016. Initially, I needed the progress bar to completely fill a column in a table. ...

Display the Sencha Touch Picker with the previously selected option showing

When using the Sencha Touch Picker component, I noticed that if I select a data and then hide the picker, upon showing it again, only the first record is selected each time. I want the picker to display my last selection when shown again. To achieve this ...