After extended periods of use, the website experiences frequent crashes

Currently, I am developing a website using a free provider (000webhost) and focusing on integrating a chat feature. To achieve this, I have implemented an interval every 500 milliseconds that reads a file to check for new messages. When a new message is detected, I load all the messages from a .txt file into an HTML element.

The chat functionality is almost complete; however, I am facing a challenge where my site crashes after extended periods of chatting or being on the chat page (approximately 3 minutes or more). Each time this occurs, I have to wait for about an hour before regaining access to the site. I use JavaScript and AJAX to refresh the chat every half-second.

Has anyone encountered a similar issue and could provide insight into what might be going wrong? I attempted to research the problem on Google but did not find any helpful solutions.

Edit: After adjusting the interval for refreshing the chat to 2.5 seconds, the website no longer crashed. It seems like this modification has resolved the issue.

Answer №1

It appears that the host has blocked your access, possibly due to too many requests being made in a short period of time. Making frequent requests from the same IP address can sometimes be mistaken for a denial-of-service attack.

There are more efficient ways to create a chat platform - consider using web sockets or node.js for better performance.

  • NodeJS Chat
  • Web Socket chat

Update

Tom mentioned in the comments that some free web hosts may not support setting up a Node server. In this case, you could try increasing the interval between requests or check with the host about any limitations they might have. Increasing the request interval may reduce the responsiveness of the chat, but it can be challenging to optimize everything on a free hosting platform.

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

Disable the ability to close the dialog box by clicking

this is my dialog <div *ngIf="visible" class="overlay" (click)="close()"> <div role="dialog" class="overlay-content"> <div class="modal-dialog" (click)="$event.stopPropagation()"> <!-- Modal content--> ...

Building chat rooms using VueJS

For my project, I am developing a Queue System using Node (SocketIO), VueJS, and MySQL. The goal is to automatically create a new chat room once 5 people have joined the queue. I already have the main chat component created, but now I need to figure out ...

Having trouble with React's conditional rendering not working as expected?

I am currently working on updating the contents of my Navbar and Router by using useContext and conditional rendering techniques. Here is a snippet from my App.js: import "./App.css"; import axios from "axios"; import { AuthContextProv ...

Tips for choosing a week on a calendar with JavaScript

Here is the code for my calendar: <script> $(document).ready(function() { var events = <?php echo json_encode($data) ?>; $('#calendar').fullCalendar({ header: { left: 'prev,next', center: &apos ...

Filtering Tables with AngularJS

Currently, I'm experimenting with using angularJS to filter data in a table. My goal is to load the data from a JSON file that has a structure like this (example file): [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, { ...

Expanding circle with CSS borders on all edges

My goal is to create a background reveal effect using JavaScript by increasing the percentage. The effect should start from the center and expand outwards in all directions. Issue: The percentage increase currently affects only the bottom and not the top ...

An error is thrown when using less.js

Every time I attempt to add less.js, I encounter an XmlHttpRequest Exception 101. Including the .less file is done using this method: <link rel="stylesheet/less" type="text/css" href="anything.less" /> This issue only arises when I upload the th ...

Issues with sending emails using Ajax/PHP script

I have successfully implemented an ajax+php script on multiple websites to send emails from HTML web pages. However, I am currently facing some difficulties in getting the script to work on a new website that I am developing. Here is the form that triggers ...

NPM: The registry cannot be found

npm http GET https://registry.npmjs.org/n npm ERR! Error: failed to fetch from registry: n npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9) npm ERR ...

The validation for the start and end dates in the datepicker is not functioning properly when

I have integrated a bootstrap date picker into my website. However, I am encountering an issue where the end date validation does not update when I change the start date after the initial selection. <script type="text/javascript" src="htt ...

Tips for including numerous hyperlinks in a single row for a website's navigation menu

I need assistance in creating a navigation bar for my website that includes multiple headers with links. I am not sure if the issue lies within my CSS, HTML, or both. Can someone please help me troubleshoot? index.html <!DOCTYPE html> <html> ...

Transform the styles from a React component into Cascading Style Sheets

I have been tasked with transitioning all the styles from the JavaScript file to the CSS file while ensuring the design remains intact. I am facing an issue where using the CSS styles breaks the search field design. The original design can be seen here: S ...

Guide to assigning a value to a model in AngularJS by utilizing a select input with an array of objects

I'm new to AngularJS and I've encountered a challenge that requires an elegant solution. My application receives a list from the server, which is used as the data source for the select tag's options. Let's assume this list represents a ...

Unable to convert JavaScript object to C# through deserialization

In order to pass a model from the controller action to the view, I included a list of objects and converted it into a JavaScript object to facilitate displaying markers on Google Maps. My goal is to send the selected object (selected marker) back to the co ...

Repeated instances in a loop are strictly prohibited

I am facing an issue with AngularJS where I am unable to display JSON data in my HTML. Below is the code I am using: $('.loading').show(); $scope.posts=[]; $http.get("https://api.basebear.com/json/tables/20a3fb1d-42c7-45cb-9440-2c6d5d10403d/r ...

Using jquery Ajax to reference PHP functions through a specified URL

Hello, I am wondering if it is possible to fetch data from a PHP function using Ajax. I would like the URL in my Ajax request to target one of my functions. Here is an example of what I have: <?php class employee{ public function __c ...

I aim to generate a JavaScript string that, when placed within a div tag, will display as a list

I need assistance with formatting a string that contains a list of items to display in a specific way within a div tag using JavaScript. The string has multiple items that I wish to show as a bulleted list. Here is an example of the string: const items = & ...

Searching for the way to access the values of a nested object's ref in Vue JS?

Within my Vue data object, I store a reference to a structure called Plot. It has properties for length, width, and acreage. interface Plot { length: number, width: number, acreage: number } const model = { plot: ref<Plot[]>([]), }) When fe ...

What methods can I use to prevent repeated login requests to SalesForce databases when using Express.js routers?

Is there a way to avoid logging into SalesForce databases and passing queries on multiple routers in express.js? It's tedious to login every time. If you have any suggestions, please let me know. var conn = new jsforce.Connection({ oauth2 : salesfo ...

Configuring web.config for Angular Universal deployment

I am trying to deploy Angular 4 Universal on Azure Web, but I am encountering some issues with the web.config file. The server.js file is located in the dist folder, so I set the path in the web.config as "dist/server.js". However, when the server.js runs ...