<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Jeet</title>
    <description>The latest articles on Forem by Jeet (@0verread).</description>
    <link>https://forem.com/0verread</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1201851%2F0181d15d-8150-4011-bd43-0c1dc498f50b.jpeg</url>
      <title>Forem: Jeet</title>
      <link>https://forem.com/0verread</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/0verread"/>
    <language>en</language>
    <item>
      <title>How to solve Data Synchronization in Next.js</title>
      <dc:creator>Jeet</dc:creator>
      <pubDate>Thu, 05 Dec 2024 18:11:39 +0000</pubDate>
      <link>https://forem.com/0verread/how-to-solve-data-synchronization-in-nextjs-8fp</link>
      <guid>https://forem.com/0verread/how-to-solve-data-synchronization-in-nextjs-8fp</guid>
      <description>&lt;p&gt;I'm building &lt;a href="//www.indexone.dev"&gt;indexone.dev&lt;/a&gt;, where I've built a service that writes new job posts periodically. This service is independent from my web app, which means it can't automatically tell my web app to show new data. As a result, the application was serving cached or outdated data even though new data was available in the database.&lt;/p&gt;

&lt;p&gt;On the other hand, I was fetching data on the server-side page, which does not revalidate data by default (this is to prevent unnecessary API calls).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawok8dnvynhxouq0bk1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawok8dnvynhxouq0bk1g.png" alt="Data fetching on server side page" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Enter Revalidation: Keeping Your Data Fresh
&lt;/h3&gt;

&lt;p&gt;Next.js provides two primary revalidation strategies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time-Based Revalidation&lt;/li&gt;
&lt;li&gt;On-Demand Revalidation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;you can learn more &lt;a href="https://nextjs.org/docs/canary/app/building-your-application/data-fetching/incremental-static-regeneration" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In my case, Time-Based Revalidation made sense. To implement this, you just need to add one line at the top of your server-side page where you're fetching data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmznnqt3om0qdbzzdhs92.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmznnqt3om0qdbzzdhs92.png" alt="Time based revalidation" width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and that's it. This whole problem took me hours to figure out, when the solution is just one line. I felt stupid.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask
&lt;/h3&gt;

&lt;p&gt;If you learned something new about Next.js from this post, or it helped you solve a problem, consider trying out &lt;a href="//www.indexone.dev"&gt;indexone.dev&lt;/a&gt; - where you can find some exciting Software Engineer jobs right after they're released, I'd love to get your feedback as it's still in the early stages and I've been building nonstop. Cheers🥂&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>nextjs</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>my first 100 stars on the GitHub repo</title>
      <dc:creator>Jeet</dc:creator>
      <pubDate>Sun, 07 Apr 2024 05:03:50 +0000</pubDate>
      <link>https://forem.com/0verread/my-first-100-stars-on-the-github-repo-466i</link>
      <guid>https://forem.com/0verread/my-first-100-stars-on-the-github-repo-466i</guid>
      <description>&lt;p&gt;This is my first post here on dev.to, and I am here to talk about one of my recent achievements - I've got 100+ stars in one of my open-source projects. Not only that, I've got 4000+ views and 2400+ unique views on my github repo, and all these happened within 24 hours.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0my1ceqb8qtcprqd0iga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0my1ceqb8qtcprqd0iga.png" alt="Github repo traffic" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My project, &lt;a href="https://github.com/0verread/goralim" rel="noopener noreferrer"&gt;goralim&lt;/a&gt;,  is a simple lightweight Golang package for rate-limiting API calls. I tried to have little to no external dependencies, so anyone can extend it with their choice of go packages and use it. &lt;/p&gt;

&lt;p&gt;I usually get stars on my GitHub repo from 2-3 friends of mine who follow me on GitHub. but that's it. But a few days back, I was kinda stress-eating and coding at night. Before I went to bed, I thought of posting the project on hackernews, thought no one would care to comment or star it, and why should they because the code is not production-ready. It's just a GitHub repo with only 2 stars and no proper documentation. &lt;/p&gt;

&lt;p&gt;When I woke up I already had 70+ stars and 20+ comments on my post. People are giving me feedback to improve it and make it better. Some people asked for some reasonable features to add (which I'm working on). and I realized the only person who thinks my projects are stupid is me. It stayed on the top 10 of the homepage of the hackernews for almost 20 hours. &lt;/p&gt;

&lt;p&gt;I'm one of those people who builds hobby projects and do not broadcast about it. I never broadcast about it because oftentimes I build stuff for my personal use and/or am not sure about my code quality ( I don't even write test cases if the number of lines of code is under 200). But I did that with almost no expectations and got overwhelming responses -  most importantly people told me who they wanted - feature requests. I was almost moving on from the project to work on my other python open-source project ( which I will release pretty soon) but now I guess I've to work on this project as well. I love this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapc99p8qtrpaq4pxtasp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapc99p8qtrpaq4pxtasp.gif" alt="Iliveforthis" width="400" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So if you're someone like me thinking no one will notice your project, just release it and talk about it - you never know what might happen. You've got nothing to lose.&lt;/p&gt;

&lt;p&gt;If you're someone who loves to contribute to open-source projects, you're more than welcome to contribute to my project&lt;br&gt;
&lt;a href="https://github.com/0verread/goralim" rel="noopener noreferrer"&gt;goralim&lt;/a&gt;. If this story of mine gave you a little bit of motivation to work on that stupid idea you've had, go work on it. Build it for yourself. And I would appreciate some stars too on my project.&lt;/p&gt;

</description>
      <category>github</category>
      <category>opensource</category>
      <category>go</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
