How JustComments reduces the amount of fetched data

How JustComments reduces the amount of fetched data

As a user, you need to create an account and copy-paste two HTML tags to your website to have a fully working comment system available to the visitors of your site.

In my spare time I work on a product called JustComments which offers a commenting system. As a user, you need to create an account and copy-paste two HTML tags to your website to have a fully working comment system available to the visitors of your site.

Here is how an integration code looks:

<div class="just-comments" data-apikey="..."></div>
<script async src="https://just-comments.com/w.js"></script>

At first, I had the entire comment system in that w.js file. Soon I noticed that I pay a lot for serving this file via a CDN and that the number of downloads of w.js is much higher than the actual number of users of the system. It matters because JustComments is a pay-as-you-go system which charges users for the number of requests made to fetch comments. The system’s code was already optimized to skip these costly requests if the user never scrolls to the comment box. But the entire comment system was getting loaded anyway.

If you look closer into where the comment boxes usually are on a page, you see that it’s after the main content in 99.9% of the cases. Sometimes it’s even hidden behind an extra button which a user needs to press to see comments.

So I decided to adjust the architecture of the system to reflect the actual usage pattern better and to bring the following benefits:

  1. The client browsers download much less data if the user never opens comments saving the bandwidth (especially crucial for mobile clients).
  2. The cost of running the service drops. Only users who would interact with the comment widget download the complete source code.

justcomments optimization performance js data visualization

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Visual Analytics and Advanced Data Visualization

Visual Analytics and Advanced Data Visualization - How CanvasJS help enterprises in creating custom Interactive and Analytical Dashboards for advanced visual analytics for data visualization

Visualization Best Practices for Data Scientists

Visualization Best Practices for Data Scientists. Disclaimer: The ideas presented in this article are from the book: Story Telling With Data by Cole Nussbaumer Knaflic.

Applications Of Data Science On 3D Imagery Data

The agenda of the talk included an introduction to 3D data, its applications and case studies, 3D data alignment and more.

The Importance of Data Visualization

The Importance of Data Visualization - It is the process of converting raw data at hand into easy and understandable image-photo-graphics for fast, effective and accurate…

Data Quality Testing Skills Needed For Data Integration Projects

Data Quality Testing Skills Needed For Data Integration Projects. Data integration projects fail for many reasons. Risks can be mitigated when well-trained testers deliver support. Here are some recommended testing skills.