<?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: Arunangshu Das</title>
    <description>The latest articles on Forem by Arunangshu Das (@arunangshu_das).</description>
    <link>https://forem.com/arunangshu_das</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%2F2959412%2F3e2a5231-72f9-47e4-b80d-085c7d800d20.png</url>
      <title>Forem: Arunangshu Das</title>
      <link>https://forem.com/arunangshu_das</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/arunangshu_das"/>
    <language>en</language>
    <item>
      <title>Is Vibe Coding the Future of Technology or a Trap?</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Wed, 09 Jul 2025 03:30:00 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/is-vibe-coding-the-future-of-technology-or-a-trap-371m</link>
      <guid>https://forem.com/arunangshu_das/is-vibe-coding-the-future-of-technology-or-a-trap-371m</guid>
      <description>&lt;p&gt;You know that feeling when you're coding at 2 AM, lo-fi music playing softly in the background, and everything just… flows? Your fingers dance on the keyboard, and solutions to problems come naturally—not from documentation or Stack Overflow, but from intuition. That’s &lt;em&gt;vibe coding&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It’s a term that’s made its way from developer meme pages into actual Twitter threads, Discord communities, and even job interviews. But what does it actually mean? Is it a productivity hack, a symptom of burnout, a romanticized version of chaos coding—or a dangerous detour from solid engineering principles?&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 1: What Even &lt;em&gt;Is&lt;/em&gt; Vibe Coding?
&lt;/h3&gt;

&lt;p&gt;“Vibe coding” isn’t a technical term. There’s no whitepaper or documentation on it. It’s an internet-born phrase that loosely describes a way of coding that’s driven more by feeling than by structure.&lt;/p&gt;

&lt;p&gt;You open your editor with no concrete plan. There’s no architectural diagram on your whiteboard. No Jira ticket to implement. No Figma prototype to follow. Just a vague goal and an energy to build something.&lt;/p&gt;

&lt;p&gt;You start typing.&lt;/p&gt;

&lt;p&gt;The code is messy. There are console.logs scattered everywhere. You mix tabs and spaces. Your variable names are bizarre. But somehow, it works. Somehow, it &lt;em&gt;feels right&lt;/em&gt;. You're vibing.&lt;/p&gt;

&lt;p&gt;Developers on Reddit and Twitter define vibe coding in different ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"Coding without thinking. Just flowing."&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"The art of getting shit done without worrying about the rules."&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Making it work before making it make sense."&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In essence, vibe coding is improvisational. It’s jazz. It’s the opposite of the corporate software engineering machine that demands test-driven development, clean architecture, code reviews, and CI/CD pipelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 2: Why Vibe Coding Became Popular
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. The Rise of Indie Hackers and Builders&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the past five years, we’ve seen a massive rise in solo devs launching micro-startups, shipping MVPs in a weekend, and building profitable side projects—all without a team or a roadmap. For these folks, vibe coding isn't just a style; it’s a necessity.&lt;/p&gt;

&lt;p&gt;You’re wearing every hat: founder, designer, marketer, and dev. You don’t have the luxury of long planning sessions or code reviews. You need speed. You need to ship fast. So, you trust your instincts and build by feeling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Burnout from Rigid Structures&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Corporate development environments are often filled with red tape. You can't even rename a variable without opening a ticket. So when side projects come around, developers naturally rebel.&lt;/p&gt;

&lt;p&gt;They &lt;em&gt;vibe code&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It’s a psychological release from the structure of 9–5 software engineering. No deadlines. No managers. No "is this scalable?" conversations. Just creativity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The Influence of Tools and AI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With tools like Copilot, GPT-4, Vercel, Supabase, and Next.js, vibe coding has become easier and more productive. You can literally describe what you want in a comment, and your AI pair programmer starts writing code for you. This feels more like directing a symphony than engineering.&lt;/p&gt;

&lt;p&gt;AI tools have blurred the line between “planning” and “doing.” If you vibe code with Copilot, you’re effectively prototyping ideas at warp speed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 3: The Pros of Vibe Coding
&lt;/h3&gt;

&lt;p&gt;Let’s be fair: vibe coding isn't all chaos and danger. In fact, there are several legitimate benefits:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;Faster Prototyping&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;When you're building something for yourself or testing an idea, speed is more valuable than perfection. Vibe coding allows you to move fast, fail fast, and iterate.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Unleashing Creativity&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Sometimes, great ideas don’t come from structured thinking—they come from exploration. When you’re not restricted by frameworks or rules, you’re more likely to stumble on innovative patterns or fresh UI/UX ideas.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;Flow State Magic&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Flow state is when you’re deeply immersed in a task, losing track of time and surroundings. Vibe coding helps you enter this state more often, especially when you code alone, with music, and with no distractions.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. &lt;strong&gt;Reduces Overengineering&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Ironically, many developers overengineer simple problems. Vibe coding strips away the pretense and forces you to ask: &lt;em&gt;what’s the simplest thing that works?&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  5. &lt;strong&gt;Lower Entry Barrier&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;For beginners and hobbyists, vibe coding lowers the barrier to experimentation. They can jump into code, get immediate feedback, and enjoy building without needing to learn SOLID principles on day one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 4: The Hidden Traps of Vibe Coding
&lt;/h3&gt;

&lt;p&gt;But it’s not all roses and lo-fi beats. Vibe coding, like all things unchecked, has a dark side.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;Scalability Nightmare&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;What works when you’re building a weekend project can become a disaster when your app starts scaling. Without clear architecture, your codebase becomes unmanageable. You spend more time untangling spaghetti than building features.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Poor Collaboration&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If you vibe code in a team environment, you’re setting yourself up for pain. Others have to understand, maintain, and debug your “magical” code. It’s like writing music only you can hear.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;Technical Debt Avalanche&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;You can ship fast, sure. But without testing, documentation, or version control hygiene, you accumulate technical debt like credit card interest. It &lt;em&gt;will&lt;/em&gt; catch up with you.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. &lt;strong&gt;False Confidence&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Because vibe coding &lt;em&gt;feels&lt;/em&gt; good, it can trick developers into thinking they’re doing the right thing—until a bug ruins their weekend or their product crashes in production.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. &lt;strong&gt;Lack of Learning&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If you rely on vibes more than fundamentals, you’re not growing. You’re coding on muscle memory, not understanding. That’s fine… until you hit a wall that instinct can’t solve.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 5: The Middle Path—Combining Vibe with Discipline
&lt;/h3&gt;

&lt;p&gt;So where does that leave us?&lt;/p&gt;

&lt;p&gt;Should we abandon vibe coding? Or should we let it take over how we build software?&lt;/p&gt;

&lt;p&gt;The answer is neither.&lt;/p&gt;

&lt;p&gt;Vibe coding, when used intentionally, is a powerful tool. But it needs to be balanced with structure, especially when working with others or building for scale.&lt;/p&gt;

&lt;p&gt;Here’s how to use vibe coding responsibly:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Use it for MVPs&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Vibe code your way to a prototype. Get the idea out fast. Validate it. Show it to users. But if it works, refactor it with discipline before scaling.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Refactor ruthlessly&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;After the vibe session, revisit your code. Add tests. Improve naming. Abstract logic. Pay your technical debt before it balloons.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Document your intuition&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If you did something clever or weird during vibe coding, write a short note on &lt;em&gt;why&lt;/em&gt; you did it. Your future self (or teammates) will thank you.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Use AI as a second brain&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Let GPT or Copilot suggest cleanups or optimizations after the initial burst of creative code. It’s like cleaning your studio after a wild jam session.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Pair vibe with tests&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;You don’t have to test-first all the time, but don’t skip tests altogether. Once your feature works, add tests to ensure it keeps working.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 6: Stories from the Field
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. The Solo SaaS Builder&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;“I built my SaaS tool in 4 weekends, completely in vibe mode,” says Tanishq, a solo founder who hit \$4k MRR last year. “I had no plan. Just a problem to solve and caffeine in my veins. But once I got traction, I had to spend a month rewriting half the app to clean up the mess.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The Burnt-Out FAANG Dev&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;“I was working at a Big Tech company where every commit took 3 days of approvals. On weekends, I’d just open VSCode and vibe code random web apps. It reminded me why I started coding in the first place.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The AI-Assisted Indie Hacker&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;“With GPT-4 and Copilot, vibe coding feels like you’re collaborating with an alien who speaks code,” says Aria, a frontend dev. “It’s fast. It’s surreal. But sometimes it goes off the rails, and you have to reel it back in with logic.”&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 7: What the Future Holds
&lt;/h3&gt;

&lt;p&gt;The future of software development is going to be &lt;em&gt;hybrid&lt;/em&gt;. Not AI vs humans. Not vibe vs structure. But both.&lt;/p&gt;

&lt;p&gt;In 5 years, you might:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sketch your idea in plain English.&lt;/li&gt;
&lt;li&gt;Let your AI assistant generate 80% of the code.&lt;/li&gt;
&lt;li&gt;Vibe through the UI until it feels right.&lt;/li&gt;
&lt;li&gt;Then run a formatter, add tests, and push to GitHub.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vibe coding won’t replace structured engineering. But it will become an accepted &lt;em&gt;phase&lt;/em&gt; in the creative cycle of building products.&lt;/p&gt;

&lt;p&gt;Much like how artists draft rough sketches before refining them, developers will use vibe coding to unlock their creative side—then sharpen it with engineering discipline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts: Should You Trust the Vibe?
&lt;/h3&gt;

&lt;p&gt;If you're a developer, vibe coding is a tool you’ll use sooner or later. The real question is: &lt;em&gt;do you know when to stop vibing and start thinking?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Like any tool, it’s powerful when used wisely—and dangerous when it becomes a habit.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>coding</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>I Quit LeetCode and Got Better at Coding</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Tue, 08 Jul 2025 03:30:00 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/i-quit-leetcode-and-got-better-at-coding-3ja</link>
      <guid>https://forem.com/arunangshu_das/i-quit-leetcode-and-got-better-at-coding-3ja</guid>
      <description>&lt;p&gt;It was around 11:47 PM on a random Tuesday night when I stared at the same LeetCode problem for the third hour in a row. “Hard” problems had started feeling less like a challenge and more like mental torture. I was tired. Not just physically, but deeply and spiritually tired of chasing a number on a profile. That night, I closed the LeetCode tab, stepped away from the screen, and told myself:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“I quit LeetCode.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But the story doesn’t end there. Strangely, it was the moment I quit LeetCode that I actually &lt;strong&gt;started getting better&lt;/strong&gt; at real coding.&lt;/p&gt;

&lt;p&gt;Let me take you through that journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  The LeetCode Obsession
&lt;/h2&gt;

&lt;p&gt;When I started LeetCode, it felt like a rite of passage. Like many aspiring software engineers, I was bombarded by the narrative:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“You NEED to grind LeetCode to get into FAANG.”&lt;br&gt;
 &lt;br&gt;
“Just do 300 questions and you’ll crack it.”&lt;br&gt;
 &lt;br&gt;
“DSA is everything.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It sounded reasonable. After all, solving algorithm problems must make you better at coding, right?&lt;/p&gt;

&lt;p&gt;So, I dived in. I signed up, found a 75-day plan, and stuck to it. I woke up early to squeeze in problems before work, spent lunch breaks explaining “two-pointer” solutions in Slack channels, and fell asleep thinking about time complexity.&lt;/p&gt;

&lt;p&gt;For a while, it was fun. There’s something addictive about green ticks and watching your problem count rise. But over time, the joy turned into guilt. On days when I couldn’t solve a problem, I felt dumb. On weekends when I didn’t open the site, I felt like I was falling behind. It became a &lt;strong&gt;grind&lt;/strong&gt;. And worst of all?&lt;/p&gt;

&lt;p&gt;I wasn't becoming a better &lt;strong&gt;developer&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Disconnect: Code vs. Coding
&lt;/h2&gt;

&lt;p&gt;At work, I was contributing to real-world codebases—frontend apps, backend APIs, build pipelines, and databases. My teammates never asked me to find the longest palindromic substring. They wanted readable code. They wanted bug-free deployments. They wanted scalability and good communication.&lt;/p&gt;

&lt;p&gt;That’s when it hit me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LeetCode was training me to be a problem-solving robot. But real-world software needed more than that.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I started noticing the difference:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;LeetCode               &lt;/th&gt;
&lt;th&gt;Real-World Coding                          &lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Algorithm puzzles      &lt;/td&gt;
&lt;td&gt;Business logic, data models                &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Optimal time complexity&lt;/td&gt;
&lt;td&gt;Maintainability and clarity                &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Solo problem-solving   &lt;/td&gt;
&lt;td&gt;Collaborative development                  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One-off solutions      &lt;/td&gt;
&lt;td&gt;Long-lived, evolving codebases             &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Test input/output      &lt;/td&gt;
&lt;td&gt;Logging, debugging, testing in real systems&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Sure, there’s value in algorithms. But somewhere along the way, I had stopped learning how to build actual systems. I was memorizing patterns, not building intuition. I was passing tests, not creating value.&lt;/p&gt;

&lt;p&gt;So I stopped.&lt;/p&gt;

&lt;p&gt;And then I got curious again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relearning Coding—The Real Way
&lt;/h2&gt;

&lt;p&gt;Once I ditched the LeetCode habit, I didn’t immediately become better at coding. Instead, I found myself asking new questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens under the hood in a real framework?&lt;/li&gt;
&lt;li&gt;How do I write code that’s easy to read three months later?&lt;/li&gt;
&lt;li&gt;Why does this API fail randomly in production?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I stopped forcing daily puzzles and started doing real things.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;I Built Projects&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I went back to basics. I built small projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A weather app that taught me API integration.&lt;/li&gt;
&lt;li&gt;A portfolio site that made me learn React deeply.&lt;/li&gt;
&lt;li&gt;A budget tracker that helped me structure my first backend API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each project revealed something new:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to organize folders.&lt;/li&gt;
&lt;li&gt;How to handle errors.&lt;/li&gt;
&lt;li&gt;How to store environment secrets.&lt;/li&gt;
&lt;li&gt;How state works in UI frameworks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LeetCode never taught me these things. But building a real product did.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;I Read Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I stopped solving contrived problems and started &lt;strong&gt;reading real-world open-source code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It was intimidating at first—naming conventions, architectural decisions, dependency management. But slowly, I began to appreciate good practices. I saw how teams structured services, handled edge cases, and wrote tests.&lt;/p&gt;

&lt;p&gt;I wasn’t just writing code anymore. I was &lt;strong&gt;learning to read it like literature&lt;/strong&gt;—understanding its flow, intent, and nuance.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;I Wrote for Humans&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Another thing I started doing? Writing better &lt;strong&gt;commit messages&lt;/strong&gt;, documentation, and comments.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because in real development, you’re not just coding for the compiler. You’re coding for future humans. And that includes yourself.&lt;/p&gt;

&lt;p&gt;I focused on &lt;strong&gt;clarity over cleverness&lt;/strong&gt;. I stopped trying to impress and started aiming to express.&lt;/p&gt;

&lt;p&gt;That one mental shift? Game changer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Improved After Quitting LeetCode
&lt;/h2&gt;

&lt;p&gt;After quitting LeetCode, here’s what actually got better:&lt;/p&gt;

&lt;h3&gt;
  
  
  My Debugging Skills
&lt;/h3&gt;

&lt;p&gt;LeetCode problems often start from a blank slate. Real-world bugs don’t.&lt;/p&gt;

&lt;p&gt;Once I started debugging actual apps—API calls that failed only in production, CSS that broke in certain screen sizes, race conditions in async JavaScript—I began developing a real &lt;strong&gt;problem-solving instinct&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;No test case could simulate the chaos of a misconfigured CI/CD pipeline or a memory leak on a live app. These were the challenges that sharpened me more than any “Top K Frequent Elements” ever did.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Communication
&lt;/h3&gt;

&lt;p&gt;In interviews, I used to get nervous explaining a LeetCode solution. Now, I can walk someone through my architecture design or justify a refactor with confidence.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because building and collaborating gave me better &lt;strong&gt;language around my thought process&lt;/strong&gt;. I practiced talking to designers, product managers, and junior devs.&lt;/p&gt;

&lt;p&gt;Turns out, explaining why your API is failing is far more valuable in the workplace than explaining how you reversed a linked list.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Design Thinking
&lt;/h3&gt;

&lt;p&gt;LeetCode problems are usually already well-defined. But real-world coding is vague. You need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decide how to structure your app.&lt;/li&gt;
&lt;li&gt;Choose between a monolith and microservices.&lt;/li&gt;
&lt;li&gt;Model data that will scale.&lt;/li&gt;
&lt;li&gt;Think of security and edge cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That freedom was terrifying—but it taught me &lt;strong&gt;systems thinking&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I started seeing problems before they became bugs. That’s a skill LeetCode rarely prepared me for.&lt;/p&gt;

&lt;h2&gt;
  
  
  But Wait—Is LeetCode All Bad?
&lt;/h2&gt;

&lt;p&gt;No, not at all.&lt;/p&gt;

&lt;p&gt;If you’re aiming for a big tech company or prepping for interviews, LeetCode absolutely has a place. It sharpens your brain, teaches you classic CS fundamentals, and builds stamina for technical interviews.&lt;/p&gt;

&lt;p&gt;But here’s my take:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;LeetCode should be a &lt;em&gt;tool&lt;/em&gt;, not a &lt;em&gt;goal&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The problem begins when we make it our identity.&lt;/p&gt;

&lt;p&gt;I’ve seen developers with 800+ problems solved but can’t deploy a Node.js app. I’ve seen juniors obsess over time complexity but ignore how to write readable code.&lt;/p&gt;

&lt;p&gt;The reality?&lt;/p&gt;

&lt;p&gt;Most jobs don’t require you to be a LeetCode warrior. They need you to &lt;strong&gt;ship quality code, solve business problems, and work with others&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Can Do Instead
&lt;/h2&gt;

&lt;p&gt;If you're tired of grinding and not growing, here's what I recommend:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Pick a Real-World Project&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Make something useful. A to-do app, a blog engine, a personal finance tracker. Build, break, and rebuild it.&lt;/p&gt;

&lt;p&gt;You’ll learn so much more than by solving problem #901 on arrays.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Contribute to Open Source&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You don’t need to be an expert. Just pick a repo, start reading, and fix a typo or small bug.&lt;/p&gt;

&lt;p&gt;You’ll experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How teams manage branches and reviews.&lt;/li&gt;
&lt;li&gt;How to write meaningful issues.&lt;/li&gt;
&lt;li&gt;How large-scale codebases evolve.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Blog What You Learn&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Nothing clarifies your thinking like writing.&lt;/p&gt;

&lt;p&gt;Try explaining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why you chose Express over Fastify.&lt;/li&gt;
&lt;li&gt;How you debugged a specific issue.&lt;/li&gt;
&lt;li&gt;What trade-offs you made in your architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’ll not only remember better—you’ll stand out to recruiters too.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Join a Community&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Find dev friends. Share your frustrations. Help others.&lt;/p&gt;

&lt;p&gt;Coding isn’t just about solving—it’s about &lt;strong&gt;belonging&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Mindset Shift That Changed Everything
&lt;/h2&gt;

&lt;p&gt;When I quit LeetCode, I didn’t just quit a platform—I quit the &lt;strong&gt;toxic mindset&lt;/strong&gt; that equated worth with problem count.&lt;/p&gt;

&lt;p&gt;I realized that real growth came when I stopped solving for &lt;strong&gt;the next problem&lt;/strong&gt;, and started solving for &lt;strong&gt;real people&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I care more about &lt;strong&gt;DX (developer experience)&lt;/strong&gt; than runtime performance.&lt;/li&gt;
&lt;li&gt;I obsess over how my code is understood, not how clever it is.&lt;/li&gt;
&lt;li&gt;I’m building things that people actually use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that feels a hundred times more fulfilling than another green check mark.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;Quitting LeetCode didn’t make me a genius overnight. But it gave me &lt;strong&gt;space&lt;/strong&gt;—to think, to explore, to grow.&lt;/p&gt;

&lt;p&gt;If you’re on the fence, here’s my honest advice:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Keep LeetCode if it serves you. But don’t let it own you.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Real coding is messy. It’s collaborative. It’s full of nuance and trade-offs and unexpected failures. But it’s also where &lt;strong&gt;the real magic happens&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;LeetCode is just one chapter.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
      <category>leetcode</category>
    </item>
    <item>
      <title>10 Key Lessons from My Failed SaaS Launch</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Mon, 07 Jul 2025 03:30:00 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/10-key-lessons-from-my-failed-saas-launch-4ih8</link>
      <guid>https://forem.com/arunangshu_das/10-key-lessons-from-my-failed-saas-launch-4ih8</guid>
      <description>&lt;p&gt;They say failure is the best teacher, but it’s not exactly the cheapest one. My first attempt at launching a SaaS product didn’t just cost me money—it burned time, energy, and ego. But now, years later, I look back at that project not with regret, but with a deep sense of appreciation for the lessons it taught me.&lt;/p&gt;

&lt;p&gt;If you’re building a SaaS product—or even &lt;em&gt;thinking&lt;/em&gt; about it—maybe this blog will help you dodge a few bullets. Or at the very least, help you feel a little less alone if things don’t go as planned.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Backstory: My Big "Aha!" Moment
&lt;/h2&gt;

&lt;p&gt;It started like many startup stories do—with a personal pain point.&lt;/p&gt;

&lt;p&gt;I was working as a freelance developer, juggling multiple clients, and managing a cluttered mess of emails, spreadsheets, Trello boards, and invoices. I thought, “What if there was a simple tool that could consolidate all client communication, deliverables, and payments into a clean dashboard?”&lt;/p&gt;

&lt;p&gt;Boom. Lightbulb moment. I sketched the idea. I even gave it a name—&lt;strong&gt;UrlClipper&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It was meant to be the all-in-one workspace for freelancers. Simple. Clean. Lightweight. Something between Notion, Trello, and Stripe—but for freelancers only.&lt;/p&gt;

&lt;h2&gt;
  
  
  I Built It. I Launched It. Nobody Came.
&lt;/h2&gt;

&lt;p&gt;Let me save you the suspense: UrlClipper flopped. Hard.&lt;/p&gt;

&lt;p&gt;After 4 months of coding nights and weekends, I launched it on Product Hunt, Indie Hackers, Twitter, and Reddit. I expected a modest response. A few upvotes, maybe a couple of signups.&lt;/p&gt;

&lt;p&gt;Instead, I got crickets.&lt;/p&gt;

&lt;p&gt;And now, with time, here are the hard-earned lessons from that failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;Build a Painkiller, Not a Vitamin&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This is perhaps the single biggest lesson.&lt;/p&gt;

&lt;p&gt;I &lt;em&gt;thought&lt;/em&gt; I was solving a pain. But what I really built was a &lt;em&gt;nice-to-have&lt;/em&gt; tool. Something that &lt;em&gt;could&lt;/em&gt; make life easier for freelancers—but wasn’t solving a mission-critical problem.&lt;/p&gt;

&lt;p&gt;Freelancers weren’t begging for an all-in-one dashboard. They already had their patchwork system. Maybe messy. But it worked. And switching to a new system meant friction—something I completely underestimated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt;&lt;br&gt;
Before you build anything, ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this a burning pain or just a minor annoyance?&lt;/li&gt;
&lt;li&gt;Are people already hacking together desperate solutions?&lt;/li&gt;
&lt;li&gt;Would people &lt;em&gt;pay&lt;/em&gt; to have this solved?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the answer to these isn’t a resounding YES, reconsider building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;strong&gt;Audience First. Product Second.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I launched to &lt;em&gt;nobody&lt;/em&gt;. Sure, I had a Twitter account and a Product Hunt page, but I hadn’t &lt;em&gt;built&lt;/em&gt; an audience. I hadn’t spent time hanging out where freelancers were. I hadn’t validated the idea. I hadn’t pre-sold or even gauged interest properly.&lt;/p&gt;

&lt;p&gt;So when I launched, it wasn’t a launch—it was a whisper in a void.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Should've Done:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Built a small email list from day one.&lt;/li&gt;
&lt;li&gt;Started sharing content regularly about freelancing and productivity.&lt;/li&gt;
&lt;li&gt;Shared behind-the-scenes posts on building the product.&lt;/li&gt;
&lt;li&gt;Collected early signups and feedback before even writing a single line of code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
Having an audience doesn’t just help with launch—it shapes your product. It makes validation faster. It creates buzz and momentum. Without it, your launch is like shouting into a storm.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;strong&gt;Code Is Expensive. Conversations Are Cheap.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I wrote thousands of lines of code. I spent weekends perfecting the dashboard, styling buttons, optimizing Stripe integration.&lt;/p&gt;

&lt;p&gt;But I spent almost &lt;em&gt;no time&lt;/em&gt; talking to actual freelancers. I assumed I knew what they wanted—because I &lt;em&gt;was&lt;/em&gt; one. But that was a dangerous assumption.&lt;/p&gt;

&lt;p&gt;What I thought was important often turned out to be irrelevant to others. The features I thought were game-changers? Barely noticed. The things I skipped? Turned out to be crucial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If I Could Go Back:&lt;/strong&gt;&lt;br&gt;
I would’ve scheduled 20 calls with freelancers before touching code.&lt;br&gt;
I would’ve asked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are your biggest daily headaches?&lt;/li&gt;
&lt;li&gt;How do you manage your clients today?&lt;/li&gt;
&lt;li&gt;What tools do you hate using?&lt;/li&gt;
&lt;li&gt;Would you pay for something simpler?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt;&lt;br&gt;
Don’t fall in love with your solution. Fall in love with the &lt;em&gt;problem&lt;/em&gt;. Talk to people. Listen more than you speak.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;Launching Is a Process, Not an Event&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I treated “launch day” like a wedding. I had a date. A Product Hunt plan. A landing page. Tweets scheduled. I even stayed up till midnight to launch it.&lt;/p&gt;

&lt;p&gt;But the world didn’t care. Why should they?&lt;/p&gt;

&lt;p&gt;The truth is, launches don’t go viral on their own. You have to earn attention. And you have to &lt;em&gt;keep launching&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Didn’t Do (But Should Have):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Share weekly product updates and user stories.&lt;/li&gt;
&lt;li&gt;Publish “building in public” updates.&lt;/li&gt;
&lt;li&gt;Collaborate with freelancers and influencers.&lt;/li&gt;
&lt;li&gt;Reach out to newsletters, blogs, and micro-communities.&lt;/li&gt;
&lt;li&gt;Run cold email campaigns to potential users.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt;&lt;br&gt;
A launch is not one day. It’s an &lt;em&gt;ongoing story&lt;/em&gt;. Keep telling it. Keep evolving it. Keep reaching out.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;SaaS Is Not Passive Income. It’s a Business.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I had a romanticized view of SaaS. Build once. Add Stripe. Sit back. Profit.&lt;/p&gt;

&lt;p&gt;Wrong.&lt;/p&gt;

&lt;p&gt;SaaS is a living, breathing business. You need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer support.&lt;/li&gt;
&lt;li&gt;Ongoing bug fixes.&lt;/li&gt;
&lt;li&gt;Onboarding flows.&lt;/li&gt;
&lt;li&gt;Churn prevention.&lt;/li&gt;
&lt;li&gt;Feature roadmap.&lt;/li&gt;
&lt;li&gt;Marketing and partnerships.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I realized how much &lt;em&gt;ongoing&lt;/em&gt; work was required, I lost steam. I hadn’t planned for the long game. I just wanted to ship something and get paid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt;&lt;br&gt;
If you’re not ready to treat it like a business, don’t launch a SaaS. It’s not a side project. It’s a long-term commitment.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. &lt;strong&gt;Don’t Skip Pricing Strategy&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I slapped on a \$9/month pricing plan. Because, you know, that’s what most SaaS tools do. No research. No logic. No validation.&lt;/p&gt;

&lt;p&gt;Turns out, my audience was either not willing to pay &lt;em&gt;at all&lt;/em&gt;, or wanted enterprise-level tools for \$9.&lt;/p&gt;

&lt;p&gt;I had no freemium model. No free trial. No pricing experiments. Just a single plan and a checkout button.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pricing is part of your product-market fit.&lt;/li&gt;
&lt;li&gt;Try different models: freemium, trials, pay-per-use, etc.&lt;/li&gt;
&lt;li&gt;Ask users what they’d be willing to pay—and why.&lt;/li&gt;
&lt;li&gt;Your price should reflect the &lt;em&gt;value&lt;/em&gt;, not the feature count.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, your pricing page is a &lt;em&gt;sales page&lt;/em&gt;, not a math problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. &lt;strong&gt;Marketing Is a Skill, Not an Afterthought&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I thought my product would “market itself.” That was naïve.&lt;/p&gt;

&lt;p&gt;I learned the hard way that building a great product is only 20% of the game. The remaining 80% is getting people to care.&lt;/p&gt;

&lt;p&gt;You need to master:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copywriting&lt;/li&gt;
&lt;li&gt;Content marketing&lt;/li&gt;
&lt;li&gt;Cold outreach&lt;/li&gt;
&lt;li&gt;SEO&lt;/li&gt;
&lt;li&gt;Email campaigns&lt;/li&gt;
&lt;li&gt;Partnerships&lt;/li&gt;
&lt;li&gt;Storytelling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I knew none of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Helped Me Later:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reading books like &lt;em&gt;Made to Stick&lt;/em&gt;, &lt;em&gt;Obviously Awesome&lt;/em&gt;, and &lt;em&gt;The Mom Test&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Following builders like Justin Welsh, Nathan Barry, and Arvid Kahl.&lt;/li&gt;
&lt;li&gt;Writing daily, building an email list, and talking to users &lt;em&gt;before&lt;/em&gt; coding.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  8. &lt;strong&gt;Metrics Matter—But Only If You Act on Them&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I installed Mixpanel, Google Analytics, and Hotjar. But I never &lt;em&gt;used&lt;/em&gt; the data properly.&lt;/p&gt;

&lt;p&gt;I saw people dropping off during onboarding—but didn’t fix it.&lt;/p&gt;

&lt;p&gt;I saw people clicking “Start Free Trial” and then bouncing—but didn’t ask why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data without action is noise.&lt;/strong&gt;&lt;br&gt;
Metrics don’t matter unless you’re making decisions based on them. Otherwise, they’re just vanity dashboards.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. &lt;strong&gt;Emotionally, It Hurts—But It’s Not the End&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When the dust settled, I felt deflated.&lt;/p&gt;

&lt;p&gt;I had poured months into something that nobody wanted. I felt like a failure. Like maybe I wasn’t cut out for SaaS. I avoided talking about it for a long time.&lt;/p&gt;

&lt;p&gt;But eventually, I realized: it wasn’t wasted time. I had learned more from that failure than from any course, book, or tutorial.&lt;/p&gt;

&lt;p&gt;And more importantly—I wasn’t alone. Every successful founder has a graveyard of failed projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. &lt;strong&gt;What I’d Do Differently If I Were Starting Today&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If I had to do it all again (and I have, since then), here’s what I’d do instead:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Start with audience + problem, not idea.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validate early with conversations and mockups.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pre-sell or build a waitlist.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Document everything in public.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Treat the launch as an ongoing campaign.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nail positioning and copy before writing a line of code.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start with a no-code MVP if possible.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stay small, stay niche, and charge early.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build something I’d use every day—even if no one else did.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Be emotionally ready for it to fail—and to try again.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts: A Failure, But Not a Waste
&lt;/h2&gt;

&lt;p&gt;UrlClipper didn’t succeed.&lt;br&gt;
 &lt;br&gt;
But &lt;em&gt;I&lt;/em&gt; succeeded in becoming a better founder, a sharper product thinker, and a more realistic entrepreneur. I launched. I learned. I licked my wounds and got back up.&lt;/p&gt;

&lt;p&gt;If you’re building something and it doesn’t work out—welcome to the club. You’re not a failure. You’re a founder. And the road to success is paved with projects that didn’t make it.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>startup</category>
      <category>learning</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>10 Best Practices for API Rate Limiting</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Thu, 03 Jul 2025 04:32:35 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/10-best-practices-for-api-rate-limiting-594n</link>
      <guid>https://forem.com/arunangshu_das/10-best-practices-for-api-rate-limiting-594n</guid>
      <description>&lt;p&gt;If you’ve ever built an API for your SaaS, mobile app, or backend services, you’ve probably been hit by the consequences of &lt;strong&gt;not having proper rate limiting&lt;/strong&gt; in place. Whether it's a rogue script flooding your endpoints or an unexpected spike from a viral app update, uncontrolled API traffic can cripple your systems.&lt;/p&gt;

&lt;p&gt;And it doesn’t just end with downtime. You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Angry users.&lt;/li&gt;
&lt;li&gt;Costly infrastructure bills.&lt;/li&gt;
&lt;li&gt;A damaged brand reputation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is API Rate Limiting?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rate limiting&lt;/strong&gt; is the process of restricting the number of API requests a user or client can make in a given timeframe.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;100 requests per minute&lt;/li&gt;
&lt;li&gt;1000 requests per day&lt;/li&gt;
&lt;li&gt;10 login attempts every 15 minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents abuse, ensures fair usage, and protects backend resources from overload.&lt;/p&gt;

&lt;p&gt;It’s especially crucial when you're hosting on cloud platforms. Even if your infrastructure scales automatically, &lt;strong&gt;uncontrolled traffic means uncontrolled costs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let’s talk about how to &lt;strong&gt;do it right&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;Set Smart and Granular Limits&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Setting a flat limit for everyone is simple, but not smart.&lt;/p&gt;

&lt;p&gt;Instead, tailor your limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Per user or API key&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Per IP address&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per route&lt;/strong&gt; (e.g., &lt;code&gt;/login&lt;/code&gt; vs &lt;code&gt;/get-profile&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per subscription plan&lt;/strong&gt; (Free, Pro, Enterprise)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Real-world tip:&lt;/em&gt; Limit high-impact endpoints like login or payment routes more strictly to avoid brute-force attacks or fraud.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;rateLimit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;windowMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;plan&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you’re on a scalable platform like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, this level of control allows you to &lt;strong&gt;allocate resources wisely without overpaying for infrastructure&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;strong&gt;Use Sliding Window or Token Bucket Algorithms&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Basic fixed-window rate limiting has loopholes. For instance, a user can send 100 requests at the end of a window and 100 more right after it resets.&lt;/p&gt;

&lt;p&gt;Better approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sliding Window Log&lt;/strong&gt; – Checks request timestamps for more accurate control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leaky Bucket / Token Bucket&lt;/strong&gt; – Allows short bursts but smooths out traffic over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;These algorithms balance fairness and flexibility. You don’t frustrate users for minor spikes, but still guard against abuse.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Popular libraries like &lt;code&gt;rate-limiter-flexible&lt;/code&gt; in Node.js support these strategies. They also integrate easily with Redis, making them fast and distributed.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;strong&gt;Give Clients Feedback&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Don’t just block requests—communicate!&lt;/p&gt;

&lt;p&gt;Send proper HTTP headers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;X-RateLimit-Limit&lt;/code&gt; – total allowed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;X-RateLimit-Remaining&lt;/code&gt; – requests left&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;X-RateLimit-Reset&lt;/code&gt; – time when the limit resets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, respond with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;429 Too Many Requests
Retry-After: 60
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Good feedback helps devs adjust their apps, automate retries, and avoid frustration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you’re building public APIs or SDKs, adding this is a must.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;Log and Monitor Rate Limit Activity&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You don’t know what you don’t track.&lt;/p&gt;

&lt;p&gt;Make sure every rate-limited request is logged. Track:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Endpoint&lt;/li&gt;
&lt;li&gt;IP address or user ID&lt;/li&gt;
&lt;li&gt;Timestamps&lt;/li&gt;
&lt;li&gt;Count of rejected requests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Send them to your monitoring platform—Datadog, Sentry, or even a simple logging service. With &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, integrating real-time log management tools is seamless and resource-efficient.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pro tip: Set up alerts for suspicious patterns (like repeated 429s from a single IP or bot).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;Whitelisting and Special Exceptions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Some systems or services &lt;em&gt;shouldn’t&lt;/em&gt; be rate limited.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your internal monitoring services&lt;/li&gt;
&lt;li&gt;Partner integrations&lt;/li&gt;
&lt;li&gt;Admin dashboards&lt;/li&gt;
&lt;li&gt;Critical cron jobs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a whitelist mechanism in your rate limiter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isWhitelisted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be careful: &lt;strong&gt;Always log exceptions and review them regularly&lt;/strong&gt;. Abuse can sneak in through whitelisted backdoors.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. &lt;strong&gt;Geo-Based Rate Controls (Underused But Powerful)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Different geographies behave differently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some have slower networks&lt;/li&gt;
&lt;li&gt;Some are prone to spam bots&lt;/li&gt;
&lt;li&gt;Some countries have regulatory limits on how services can behave&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using IP geolocation data, you can fine-tune limits.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;geo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;country&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;IN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;geo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;country&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RU&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Platforms like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; allow &lt;strong&gt;geographic load balancing and edge caching&lt;/strong&gt;, so combining this with API-level control gives you a huge performance edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. &lt;strong&gt;Rate Limit by Endpoint Sensitivity&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Not all API endpoints are equal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/get-products&lt;/code&gt; can be called often.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/create-order&lt;/code&gt; should be limited.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/delete-user&lt;/code&gt; needs extra control and logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Customize rate limits per route:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/create-order&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;rateLimit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;windowMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/get-products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;rateLimit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Fine-grained control = better user experience without compromising backend safety.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  8. &lt;strong&gt;Implement User-Friendly Retry Behavior&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Just blocking clients is harsh. Encourage retry logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backoff delays (e.g., retry after 5s, then 10s, then 20s)&lt;/li&gt;
&lt;li&gt;Retry headers (&lt;code&gt;Retry-After&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;JSON error responses like:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Too many requests"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"retry_after"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure your SDKs or frontend apps &lt;strong&gt;gracefully handle&lt;/strong&gt; 429 responses.&lt;/p&gt;

&lt;p&gt;If you’re running your backend behind a platform like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, you can use NGINX or Varnish at the edge to &lt;strong&gt;throttle traffic before it reaches your app&lt;/strong&gt;, saving both CPU cycles and user frustration.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. &lt;strong&gt;Distribute Rate Limiting Across Servers (Use Redis or Memcached)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If your API is hosted across multiple nodes, &lt;strong&gt;local memory won’t work&lt;/strong&gt; for rate limiting—it won’t sync limits across instances.&lt;/p&gt;

&lt;p&gt;Use a shared data store like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Redis&lt;/strong&gt; – Fast, atomic operations, ideal for rate limiting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memcached&lt;/strong&gt; – Simple key-value, works well for basic scenarios&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🔧 Popular tools like &lt;code&gt;express-rate-limit&lt;/code&gt;, &lt;code&gt;rate-limiter-flexible&lt;/code&gt;, or &lt;code&gt;throttled&lt;/code&gt; support Redis out of the box.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; makes it easy to plug in Redis or Memcached on your server with just a few clicks. You don’t have to manage them manually—let the platform do the heavy lifting.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. &lt;strong&gt;Scale Rate Limiting with Usage Tiers&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If your API is part of a SaaS product, monetize usage with API tiers.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free plan: 100 requests/day&lt;/li&gt;
&lt;li&gt;Pro plan: 10,000 requests/day&lt;/li&gt;
&lt;li&gt;Enterprise: Unlimited, with SLAs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Build logic that reads user plan and sets limits accordingly.&lt;/p&gt;

&lt;p&gt;Also, expose usage stats in the user dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"daily_limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"used"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3871&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"resets_in"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3h 24m"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This encourages upgrades and gives users transparency. Platforms like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; can help you scale this quickly and securely—just deploy a Node.js backend with MongoDB or PostgreSQL, and you’re good to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tip: Combine Rate Limiting with API Gateway Rules
&lt;/h2&gt;

&lt;p&gt;If your traffic is large or globally distributed, consider fronting your API with an API Gateway like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NGINX&lt;/li&gt;
&lt;li&gt;Cloudflare Workers&lt;/li&gt;
&lt;li&gt;AWS API Gateway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gateways offer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request inspection&lt;/li&gt;
&lt;li&gt;Geo-based throttling&lt;/li&gt;
&lt;li&gt;Custom rule sets&lt;/li&gt;
&lt;li&gt;WAF (Web Application Firewall) integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re hosting on &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, using Cloudflare in front of your servers is a common and easy-to-implement strategy. You get &lt;strong&gt;rate limiting, caching, and DDoS protection all in one shot&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts: Don’t Just Rate Limit—Do It Right
&lt;/h2&gt;

&lt;p&gt;Rate limiting isn’t a checkbox—it’s a crucial layer in your architecture. When done right, it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeps your services stable&lt;/li&gt;
&lt;li&gt;Defends against spam and bots&lt;/li&gt;
&lt;li&gt;Protects your infrastructure budget&lt;/li&gt;
&lt;li&gt;Adds polish to your API UX&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But to implement it well, you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Control&lt;/li&gt;
&lt;li&gt;Observability&lt;/li&gt;
&lt;li&gt;Scaling flexibility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why I highly recommend testing and deploying your API infrastructure on a managed, developer-friendly cloud platform like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;. Their ability to handle autoscaling, Redis integration, NGINX preconfigured support, and secure deployments &lt;strong&gt;makes adding smart rate limiting a breeze&lt;/strong&gt;—without the headaches of server management.&lt;/p&gt;

&lt;p&gt;In fact, most of the production APIs I’ve built or helped scale are running smoothly today &lt;em&gt;because&lt;/em&gt; we got rate limiting right from day one.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR — 10 Best Practices Recap
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Set smart per-user/IP/route limits&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use advanced algorithms like token bucket&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Give clear feedback with headers and status codes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Log and monitor rejected requests&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Whitelist internal and partner apps&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use geo-based limits for smarter control&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tailor limits by endpoint sensitivity&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Support retries and backoff mechanisms&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use distributed stores like Redis&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scale limits by user plan and expose usage stats&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And if you’re still deploying on shared hosting or traditional VPS, it might be time to give platforms like &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt; a spin. Once you experience the freedom of painless scaling and integrated monitoring, you won’t want to go back.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>How to Securely Host Frontend and Backend Together</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Wed, 02 Jul 2025 03:30:00 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/how-to-securely-host-frontend-and-backend-together-3236</link>
      <guid>https://forem.com/arunangshu_das/how-to-securely-host-frontend-and-backend-together-3236</guid>
      <description>&lt;p&gt;Let’s be honest—building a great app isn’t enough. You could write elegant code, perfect your UI/UX, and optimize your APIs to the core, but if your deployment is messy or insecure, everything else could crumble like a house of cards.&lt;/p&gt;

&lt;p&gt;Whether you're a solo developer launching your dream SaaS product, a freelancer managing multiple client websites, or a team scaling a production-grade app, knowing &lt;strong&gt;how to host frontend and backend together securely&lt;/strong&gt; is a &lt;em&gt;superpower&lt;/em&gt;. But the problem is—there’s too much noise. Too many platforms, deployment workflows, certificates, reverse proxies, and most importantly, too many ways to mess it up.&lt;/p&gt;

&lt;p&gt;So, how do you simplify this chaos &lt;em&gt;without compromising on security or scalability&lt;/em&gt;?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Host Frontend and Backend Together?
&lt;/h2&gt;

&lt;p&gt;Before jumping into the “how,” let’s answer the “why.” Is it even a good idea?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes, and here’s why it can be awesome:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improved DevOps Simplicity&lt;/strong&gt;: One deployment pipeline, one server or platform, one place to debug.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: When frontend and backend are hosted together, they can share the same domain. This reduces DNS lookups and improves latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Fewer exposed endpoints across different domains reduces your surface area for attack. Shared security policies become easier to manage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO &amp;amp; SSR&lt;/strong&gt;: If you’re using SSR frameworks like Next.js or Nuxt, keeping things together is not just convenient—it’s essential.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session and Cookie Handling&lt;/strong&gt;: Avoid CORS and cross-domain cookie issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But none of this matters if you don’t &lt;em&gt;secure&lt;/em&gt; the stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real-World Stack We’ll Use in This Guide
&lt;/h2&gt;

&lt;p&gt;Let’s assume a very common real-world setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React (built using Vite or Create React App)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Node.js/Express or Fastify (REST or GraphQL)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosting Platform&lt;/strong&gt;: A secure cloud platform (&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; or similar)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt;: Ubuntu-based VPS or containerized environment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSL&lt;/strong&gt;: Let’s Encrypt or custom SSL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain&lt;/strong&gt;: Single domain (e.g., &lt;code&gt;myapp.com&lt;/code&gt;) or subdomains (e.g., &lt;code&gt;api.myapp.com&lt;/code&gt;, &lt;code&gt;app.myapp.com&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And yes, if you’re not a full-time DevOps engineer, this might feel overwhelming. That’s why we’ll show how you can do this on platforms like &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt;, which take care of most of the heavy lifting, while still giving you root-level control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step: Securely Hosting Frontend + Backend
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Build Your Frontend (Static Files)
&lt;/h3&gt;

&lt;p&gt;Most modern frontend frameworks (React, Vue, Svelte) compile down to static assets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate a &lt;code&gt;dist&lt;/code&gt; or &lt;code&gt;build&lt;/code&gt; folder containing &lt;code&gt;index.html&lt;/code&gt;, JavaScript bundles, and assets. These files can be served using any static file server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minify and compress your output.&lt;/li&gt;
&lt;li&gt;Use hashing in filenames for cache busting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Setup a Secure Backend Server
&lt;/h3&gt;

&lt;p&gt;Create a Node.js server that serves your API and optionally your frontend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="c1"&gt;// Security headers&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;helmet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;helmet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;helmet&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="c1"&gt;// Rate limiting&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rateLimit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express-rate-limit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rateLimit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;windowMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="c1"&gt;// CORS (if frontend is on different domain)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cors&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="c1"&gt;// Serve static files&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;static&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="c1"&gt;// API routes&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="c1"&gt;// Fallback to index.html for SPA&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;index.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server running securely on port 3000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Security Checklist:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;helmet&lt;/code&gt; for HTTP headers&lt;/li&gt;
&lt;li&gt;Enforce HTTPS (either via proxy or SSL)&lt;/li&gt;
&lt;li&gt;Set proper CORS policies&lt;/li&gt;
&lt;li&gt;Add rate limiting&lt;/li&gt;
&lt;li&gt;Validate and sanitize inputs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Pick a Hosting Platform That Doesn’t Make You Cry
&lt;/h3&gt;

&lt;p&gt;This is where developers often get stuck.&lt;/p&gt;

&lt;p&gt;Some go full DIY with a VPS (like DigitalOcean or AWS EC2), but end up spending hours configuring NGINX, setting up firewall rules, worrying about updates and patches.&lt;/p&gt;

&lt;p&gt;If you want &lt;strong&gt;a developer-friendly yet scalable hosting experience&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt; is an excellent choice.&lt;/p&gt;

&lt;p&gt;You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1-Click deployment for Node.js apps&lt;/li&gt;
&lt;li&gt;Easy SSL installation&lt;/li&gt;
&lt;li&gt;Integrated firewalls&lt;/li&gt;
&lt;li&gt;Server monitoring&lt;/li&gt;
&lt;li&gt;Application-level isolation&lt;/li&gt;
&lt;li&gt;Git + CI/CD support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s basically a managed hosting platform &lt;em&gt;without vendor lock-in&lt;/em&gt;. You still choose your infrastructure (DigitalOcean, AWS, etc.), but &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; handles security, updates, and performance tuning&lt;/strong&gt;. It saves hours—especially if you’re running a startup or side project with limited DevOps bandwidth.&lt;/p&gt;

&lt;p&gt;And let’s be real—what you save in DevOps cost easily offsets the subscription.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Set Up Your Server Environment (with &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; or VPS)
&lt;/h3&gt;

&lt;p&gt;Once you've chosen your platform, here's what to do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Provision a Server&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Choose your cloud provider and server size.&lt;/li&gt;
&lt;li&gt;Select a data center near your audience.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Install Node.js App&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Use a Node.js template on &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Or manually install using &lt;code&gt;pm2&lt;/code&gt; on a raw VPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Deploy Your Code&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Use Git, SFTP, or CI/CD tools.&lt;/li&gt;
&lt;li&gt;Set your environment variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Enable HTTPS&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Install Let’s Encrypt SSL via &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; UI (2 clicks).&lt;/li&gt;
&lt;li&gt;For VPS, use Certbot:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  sudo apt &lt;span class="nb"&gt;install &lt;/span&gt;certbot
  sudo certbot &lt;span class="nt"&gt;--nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Configure Firewall&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Only allow essential ports (80, 443, 22).&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;’ security group settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Use Reverse Proxy or Serve Frontend from Backend
&lt;/h3&gt;

&lt;p&gt;There are two ways to connect frontend + backend:&lt;/p&gt;

&lt;h4&gt;
  
  
  Option 1: Serve Frontend Through Backend
&lt;/h4&gt;

&lt;p&gt;This is the easiest method. Your Express app will serve static files, as shown earlier. Works great for SPAs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One domain (&lt;code&gt;myapp.com&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;No CORS issues&lt;/li&gt;
&lt;li&gt;Easier SSL setup&lt;/li&gt;
&lt;li&gt;Backend must also restart if frontend changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Option 2: Use Reverse Proxy (NGINX)
&lt;/h4&gt;

&lt;p&gt;Here, you deploy frontend and backend as separate services and use NGINX to route.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;myapp.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt; &lt;/span&gt;
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="s"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://localhost:3001&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kn"&gt; &lt;/span&gt; &lt;span class="c1"&gt;# React app&lt;/span&gt;
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="s"&gt; &lt;/span&gt;
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="s"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/api&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kn"&gt; &lt;/span&gt; &lt;span class="c1"&gt;# Node API&lt;/span&gt;
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Independent deployments&lt;/li&gt;
&lt;li&gt;Better scaling&lt;/li&gt;
&lt;li&gt;CORS and subdomain config needed&lt;/li&gt;
&lt;li&gt;Slightly more complex&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're on &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt;, reverse proxy rules can be configured using their UI or by editing server config via SSH.&lt;/p&gt;

&lt;h2&gt;
  
  
  Essential Security Enhancements
&lt;/h2&gt;

&lt;p&gt;You’ve hosted the app. Now let’s harden it.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;HTTPS Everywhere&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If users can still access HTTP, you’re vulnerable to MITM attacks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;' free SSL + auto-renew.&lt;/li&gt;
&lt;li&gt;Redirect all traffic to HTTPS in your server code or NGINX.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;CSP Headers&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use Content Security Policy to restrict scripts/styles loading:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;helmet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contentSecurityPolicy&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;directives&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;defaultSrc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;'self'&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;scriptSrc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;'self'&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;trusted-cdn.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;styleSrc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;'self'&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fonts.googleapis.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. &lt;strong&gt;DDOS Protection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Most managed platforms like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; include basic DDOS protection. For VPS, you can use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare Proxy&lt;/li&gt;
&lt;li&gt;Fail2ban&lt;/li&gt;
&lt;li&gt;IPTables&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Database Security&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Never expose MongoDB/Postgres ports publicly.&lt;/li&gt;
&lt;li&gt;Use SSH tunnels or internal networking.&lt;/li&gt;
&lt;li&gt;Rotate credentials every 60–90 days.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Monitoring &amp;amp; Logging&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use a combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; Application Monitoring&lt;/li&gt;
&lt;li&gt;PM2 logs&lt;/li&gt;
&lt;li&gt;Uptime Robot or Pingdom&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bonus: Simplified CI/CD for Full-Stack Apps
&lt;/h2&gt;

&lt;p&gt;Automate your deployments with Git-based workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Push code to GitHub&lt;/li&gt;
&lt;li&gt;Webhook triggers build on your backend&lt;/li&gt;
&lt;li&gt;Frontend rebuilds and deploys with post-hook script&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, you can set deployment hooks, configure multiple Git branches, and auto-deploy to staging or production. This keeps you agile and secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary Checklist
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task                                       &lt;/th&gt;
&lt;th&gt;Done?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Built secure static frontend               &lt;/td&gt;
&lt;td&gt;✅    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Created secure Express backend             &lt;/td&gt;
&lt;td&gt;✅    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Served frontend via backend or NGINX       &lt;/td&gt;
&lt;td&gt;✅    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enabled HTTPS and firewall                 &lt;/td&gt;
&lt;td&gt;✅    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployed to secure cloud platform          &lt;/td&gt;
&lt;td&gt;✅    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configured monitoring, rate limits, headers&lt;/td&gt;
&lt;td&gt;✅    &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;You don’t need a huge DevOps team to securely host your full-stack app. What you &lt;em&gt;do&lt;/em&gt; need is a good understanding of the moving parts—and a platform that simplifies complexity without compromising power.&lt;/p&gt;

&lt;p&gt;Platforms like &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt; are made exactly for developers like us—those who want full control when needed, but also want to sleep at night knowing SSL, updates, and security are handled. And that’s what makes all the difference.&lt;/p&gt;

&lt;p&gt;So the next time you're launching your product, client project, or MVP—don’t overcomplicate your hosting.&lt;/p&gt;

&lt;p&gt;Keep it simple. Keep it secure. And if you’re ready to deploy something that just works, &lt;strong&gt;try a managed platform&lt;/strong&gt; that won’t slow you down.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>backenddevelopment</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>10 Tips for Optimizing Node.js with Built-In Caching</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Tue, 01 Jul 2025 04:32:14 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/10-tips-for-optimizing-nodejs-with-built-in-caching-a85</link>
      <guid>https://forem.com/arunangshu_das/10-tips-for-optimizing-nodejs-with-built-in-caching-a85</guid>
      <description>&lt;p&gt;Node.js is a powerful platform for building fast, scalable applications, especially for real-time and data-heavy operations. But with power comes responsibility. As your application grows, so do your performance concerns. One of the most efficient ways to solve performance bottlenecks without throwing more hardware at the problem is &lt;strong&gt;caching&lt;/strong&gt;—and yes, Node.js has plenty of native and built-in techniques to help you do that.&lt;/p&gt;

&lt;p&gt;If you're deploying your Node.js apps on platforms like &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt;, you’ll also notice a big performance boost just by combining these caching techniques with a solid managed infrastructure. It's like adding turbo to your engine—optimized code on optimized hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Caching (and Why It Matters in Node.js)?
&lt;/h2&gt;

&lt;p&gt;Caching is the process of storing a copy of data in a temporary storage layer so future requests for that data can be served faster. Think of it like having a fast-access drawer for your most-used items rather than fetching them from the basement every time.&lt;/p&gt;

&lt;p&gt;In Node.js, you often deal with I/O-bound operations—database queries, file system access, or external API calls. All of these can become bottlenecks. With caching, you &lt;strong&gt;reduce latency, cut down on repeated computation&lt;/strong&gt;, and lower the load on your backend services.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;Use In-Memory Caching with a JavaScript Object&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For many use cases, the simplest and fastest cache is just… an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getFromCacheOrCompute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;computeFn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;computeFn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is incredibly fast and perfect for short-lived data or read-heavy operations. But keep in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It doesn’t persist across server restarts.&lt;/li&gt;
&lt;li&gt;You’ll need to manage memory to avoid leaks.&lt;/li&gt;
&lt;li&gt;It’s only available to a single Node.js process (not suitable for distributed apps).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For single-instance apps or functions like API token validation, settings lookup, or static configuration values, this approach works beautifully.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Use this for &lt;strong&gt;frequently accessed computed values&lt;/strong&gt; that don't change often.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. &lt;strong&gt;Use &lt;code&gt;require()&lt;/code&gt; to Cache Modules Automatically&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Did you know &lt;code&gt;require()&lt;/code&gt; in Node.js caches the modules it loads?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every time you require the same file, Node.js serves it from the cache. This is great for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loading configuration files&lt;/li&gt;
&lt;li&gt;Reusing utility libraries&lt;/li&gt;
&lt;li&gt;Reducing startup time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to bust the cache, you can delete it manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in most cases, just let Node handle it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Leverage &lt;code&gt;require()&lt;/code&gt; caching when designing modules—break logic into reusable files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. &lt;strong&gt;Use &lt;code&gt;Map&lt;/code&gt; for Predictable In-Memory Caching&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While plain objects work, &lt;strong&gt;&lt;code&gt;Map&lt;/code&gt;&lt;/strong&gt; gives you more control and performance for dynamic keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cacheMap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;cacheData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;cacheMap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getCachedData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cacheMap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike plain objects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Map&lt;/code&gt; preserves insertion order&lt;/li&gt;
&lt;li&gt;It allows any type as keys (not just strings)&lt;/li&gt;
&lt;li&gt;It has better performance for frequent additions/removals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also pair this with expiration logic or even TTL using timestamps.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Use &lt;code&gt;Map&lt;/code&gt; when dealing with dynamic or frequent keys, like search queries or session info.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;Add TTL Support to Your Cache&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Sometimes, cached data shouldn’t live forever. Implementing TTL (Time-To-Live) is essential.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setWithTTL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ttlMs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;expiresAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;ttlMs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getWithTTL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;expiresAt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TTL helps ensure freshness, especially for data like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API results&lt;/li&gt;
&lt;li&gt;Auth tokens&lt;/li&gt;
&lt;li&gt;Feature flags&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Regularly sweep expired entries or use a background cleanup interval.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;Memoize Expensive Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Memoization is a caching technique where you store the result of expensive function calls.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;memoize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For functions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex math computations&lt;/li&gt;
&lt;li&gt;String transformations&lt;/li&gt;
&lt;li&gt;Parsing routines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Memoization can significantly reduce CPU usage.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Be mindful of cache size—use an LRU (Least Recently Used) policy if needed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  6. &lt;strong&gt;Cache Asynchronous Results&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It’s common to have async operations like API requests or DB calls. Cache those too!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchWithCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fetchFn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ttl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expiresAt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;expiresAt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetchFn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expiresAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;ttl&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use this for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rate-limited APIs&lt;/li&gt;
&lt;li&gt;Expensive DB joins&lt;/li&gt;
&lt;li&gt;Auth provider metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: This is especially useful in SSR (server-side rendering) and background job queues.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. &lt;strong&gt;Cache Static Files in Memory&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Serving static files? Instead of reading from disk on each request, cache them in memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fileCache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getStaticFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fileCache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fileCache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;fileCache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combine this with a middleware for serving assets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/assets&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getStaticFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`./public/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Tip: Preload frequently requested files at startup to avoid delay on the first request.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  8. &lt;strong&gt;Use Cluster and Shared Caching Wisely&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you're using Node.js clusters or worker threads, remember each worker has its own memory space. A cache created in one won't be available in another.&lt;/p&gt;

&lt;p&gt;For shared caching:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use external stores (like Redis or Memcached)&lt;/li&gt;
&lt;li&gt;Or, in simpler cases, use IPC (inter-process communication) to sync&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for built-in solutions, use caching per worker and design accordingly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: If you're deploying to managed hosting (like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;), their multi-core optimization handles this well, especially when combined with Redis or Memcached integration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  9. &lt;strong&gt;Serve Frequently Accessed JSON via Cache&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Have a settings API or a frequently read config endpoint?&lt;/p&gt;

&lt;p&gt;Cache the result of those file reads and serve the same parsed object to reduce file I/O.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cachedConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cachedConfig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cachedConfig&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./config.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;cachedConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cachedConfig&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is much faster than re-parsing JSON on every call.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Bust the cache with a CLI command or API endpoint when updating config dynamically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  10. &lt;strong&gt;Combine Caching with Edge Deployment&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This is where things get really exciting.&lt;/p&gt;

&lt;p&gt;You’ve implemented caching in your Node.js app. Great. But now imagine combining that with &lt;strong&gt;edge-level caching&lt;/strong&gt; through a platform like &lt;strong&gt;&lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt;, which offers CDN, Redis, and fast SSD hosting out of the box.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cache HTML fragments at the edge&lt;/li&gt;
&lt;li&gt;Cache API results in memory + Redis&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;cache-control&lt;/code&gt; headers to control frontend browser caching&lt;/li&gt;
&lt;li&gt;Set up Varnish caching with minimal config&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if your internal cache misses, &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; can serve the request lightning fast with its built-in layers—so the user never feels the delay.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Don’t just rely on in-app caching—&lt;strong&gt;deploy on an optimized platform&lt;/strong&gt; where your cache can stretch from memory to edge to browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Bonus: When &lt;strong&gt;Not&lt;/strong&gt; to Cache
&lt;/h2&gt;

&lt;p&gt;Caching is powerful, but use it wisely. Avoid caching:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sensitive or user-specific data without proper isolation&lt;/li&gt;
&lt;li&gt;Rapidly changing values (like real-time counters)&lt;/li&gt;
&lt;li&gt;Anything that must be 100% fresh (like stock prices or auction bids)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Caching stale or incorrect data is worse than no cache at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Caching is one of those secret weapons in every developer’s toolkit. In Node.js, you don’t even need fancy libraries to start seeing benefits—you can do a lot with native objects, &lt;code&gt;Map&lt;/code&gt;, and thoughtful function design.&lt;/p&gt;

&lt;p&gt;But when you combine that with a &lt;strong&gt;high-performance managed hosting platform like &lt;a href="https://arunangshudas.com/cloudways" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt;, it’s a game-changer. You get the best of both worlds: efficient code and infrastructure designed for scale.&lt;/p&gt;

&lt;p&gt;If you're serious about optimizing your app, deploy your next Node.js project on a platform that helps you scale with confidence—and &lt;strong&gt;watch your response times drop, user satisfaction rise, and server costs shrink&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cloudways</category>
      <category>discuss</category>
      <category>node</category>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>5 Benefits of Server-Side Compression for Your Website</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Wed, 25 Jun 2025 03:38:56 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/5-benefits-of-server-side-compression-for-your-website-1ngb</link>
      <guid>https://forem.com/arunangshu_das/5-benefits-of-server-side-compression-for-your-website-1ngb</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;“Speed is a feature.”&lt;br&gt;
— Fred Wilson, Venture Capitalist&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In today’s internet economy, speed is everything.&lt;/p&gt;

&lt;p&gt;We talk a lot about front-end optimization: lazy-loading images, minifying CSS, using fewer fonts, or optimizing React bundles. But one incredibly powerful, often overlooked technique lies on the &lt;em&gt;server side&lt;/em&gt;—compression.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Server-Side Compression?
&lt;/h2&gt;

&lt;p&gt;Server-side compression is the process where your web server compresses files (HTML, CSS, JavaScript, etc.) before sending them to the browser. The browser then decompresses them, almost instantly, and renders the page.&lt;/p&gt;

&lt;p&gt;Imagine packing a suitcase with clothes. Compression folds and squishes them down to take up less space. You still get the same clothes at your destination, but they took up less room and weight during the journey.&lt;/p&gt;

&lt;p&gt;And just like a lighter suitcase makes for a faster airport check-in, compressed data makes your site load faster.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technologies Behind Server-Side Compression
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gzip:&lt;/strong&gt; The most widely adopted method. Fast, effective, and supported by nearly every browser and server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brotli:&lt;/strong&gt; A newer, more efficient algorithm developed by Google. Offers better compression than Gzip, especially for text-heavy content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zstandard (Zstd):&lt;/strong&gt; Emerging for modern systems with improved speed and compression ratio.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most modern web servers—Apache, Nginx, LiteSpeed—support compression. But simply enabling it can feel like magic when you see the difference in your Lighthouse scores.&lt;/p&gt;

&lt;p&gt;Now let’s dig into the real &lt;em&gt;benefits&lt;/em&gt; of using server-side compression. These are not just theoretical perks—they solve real-world pain points that developers and business owners face every day.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;Lightning-Fast Load Times (Even on Slow Networks)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here’s a stat that might shock you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A 1-second delay in page load time can lead to a 7% loss in conversions. &lt;em&gt;(Source: Akamai)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Server-side compression reduces the size of text files sent from server to browser—by &lt;strong&gt;up to 90%&lt;/strong&gt;. This means that users with slow 3G connections or throttled bandwidth (think rural areas or mobile hotspots) can still load your site fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
A 300 KB HTML file can be compressed down to 30–40 KB using Brotli. That’s a massive drop in network payload.&lt;/p&gt;

&lt;p&gt;And here's the kicker—you don’t have to change a single line of HTML or JavaScript. Just turn on compression at the server level and your users enjoy faster page loads instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-World Impact
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Faster Time to First Byte (TTFB):&lt;/strong&gt; Because smaller files get served faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lower First Contentful Paint (FCP):&lt;/strong&gt; Users see something rendered on screen quicker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Core Web Vitals:&lt;/strong&gt; Which directly affects SEO rankings, especially on mobile.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Want to see real results? Platforms like &lt;strong&gt;&lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt; make enabling Brotli or Gzip as easy as a toggle. You don’t have to mess with &lt;code&gt;.conf&lt;/code&gt; files or SSH into your server. It’s beginner-friendly &lt;em&gt;and&lt;/em&gt; developer-respectful.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. &lt;strong&gt;Better SEO Rankings and Discoverability&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Google is obsessed with speed. Their crawler prioritizes fast-loading pages. And their algorithm is built to reward websites that offer better user experience, especially on mobile.&lt;/p&gt;

&lt;p&gt;Since July 2021, Core Web Vitals are official ranking factors. These metrics—like LCP (Largest Contentful Paint) and CLS (Cumulative Layout Shift)—are directly influenced by how quickly your content arrives and renders.&lt;/p&gt;

&lt;p&gt;Server-side compression helps you reduce:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HTML payloads&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Render-blocking CSS&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inline JavaScript size&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Smaller payload = faster load = better score.&lt;/p&gt;

&lt;p&gt;So if your blog or product pages aren’t ranking on Google Discover or you’re failing PageSpeed Insights checks, enabling compression is often the easiest and most effective quick fix.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Personal Example
&lt;/h3&gt;

&lt;p&gt;When I moved one of my side-projects from a shared cPanel hosting to a server managed by &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, I instantly saw a bump in speed—and within a month, blog impressions from Google doubled.&lt;/p&gt;

&lt;p&gt;Was compression the only factor? No. But it was one of the &lt;em&gt;easiest&lt;/em&gt; levers to pull with maximum return.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;strong&gt;Lower Server Bandwidth and Hosting Costs&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Every byte served from your server costs resources. More traffic means more data transfer, which means higher hosting bills or slower shared resources.&lt;/p&gt;

&lt;p&gt;Compression doesn’t just make things fast—it makes your &lt;strong&gt;backend more efficient&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your server sends &lt;em&gt;less&lt;/em&gt; data per request&lt;/li&gt;
&lt;li&gt;The client receives &lt;em&gt;exactly&lt;/em&gt; the same content&lt;/li&gt;
&lt;li&gt;Your bandwidth consumption &lt;em&gt;drops significantly&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s say your site serves 100,000 page views a month, and each page loads 600 KB of text assets.&lt;/p&gt;

&lt;p&gt;Without compression, that’s 60 GB/month.&lt;br&gt;
With Gzip (70% reduction), it's 18 GB/month.&lt;br&gt;
With Brotli (up to 85%), it's closer to &lt;strong&gt;9 GB/month&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That’s 51 GB saved.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fewer bytes = cheaper plans, especially if you're on metered bandwidth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're hosting on a cloud platform like &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; (where pricing is usage-based but predictable), this optimization can stretch your infrastructure cost &lt;em&gt;farther&lt;/em&gt; without sacrificing performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;A Smoother User Experience on All Devices&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Users today are spread across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mobile phones (with limited CPU)&lt;/li&gt;
&lt;li&gt;Tablets&lt;/li&gt;
&lt;li&gt;Low-end laptops&lt;/li&gt;
&lt;li&gt;Smart TVs&lt;/li&gt;
&lt;li&gt;Wearables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not everyone has the latest iPhone with blazing-fast 5G.&lt;/p&gt;

&lt;p&gt;Server-side compression helps &lt;em&gt;everyone&lt;/em&gt;, regardless of device or browser. By serving compressed text-based assets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Devices render pages with less CPU effort&lt;/li&gt;
&lt;li&gt;Browsers decompress faster (modern compression algorithms are hardware-friendly)&lt;/li&gt;
&lt;li&gt;Less jank, fewer page stalls, better scrolling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think about someone browsing your site while commuting through a tunnel, or on an unstable café Wi-Fi. Server-side compression is like giving them a performance booster without needing a new phone.&lt;/p&gt;

&lt;p&gt;And the best part? You &lt;em&gt;don’t&lt;/em&gt; need a CDN or front-end framework overhaul to get these benefits.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;Effortless Performance Wins with Minimal Dev Work&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When we talk about performance improvements—some optimizations require massive dev work: code-splitting, hydration tweaks, build tooling, caching layers.&lt;/p&gt;

&lt;p&gt;But server-side compression?&lt;/p&gt;

&lt;p&gt;It’s a few toggles away. Especially if you're using a platform like &lt;strong&gt;&lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Looks on &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;When you're managing your app on &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable Brotli with a single click&lt;/li&gt;
&lt;li&gt;Choose from Apache or Nginx&lt;/li&gt;
&lt;li&gt;Integrate with Varnish and Redis for full-stack speed&lt;/li&gt;
&lt;li&gt;Use their built-in &lt;strong&gt;“Server Settings &amp;amp; Packages”&lt;/strong&gt; to toggle compression levels without touching the terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No sysadmin background? No problem.&lt;/p&gt;

&lt;p&gt;Their UI is dev-friendly &lt;em&gt;and&lt;/em&gt; understandable for founders or solo makers. It's rare to find a host that bridges that gap so well.&lt;/p&gt;

&lt;p&gt;And if you're running a Node.js app or a WordPress stack, &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; optimizes compression &lt;em&gt;without you lifting a finger&lt;/em&gt; beyond that one-time setup.&lt;/p&gt;

&lt;p&gt;That’s what makes it so powerful—it’s a passive speed win.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Why &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; Makes Compression Stupidly Simple
&lt;/h2&gt;

&lt;p&gt;You don’t need to pick &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; for this optimization to work. But if you’re tired of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fighting cPanel settings&lt;/li&gt;
&lt;li&gt;Googling &lt;code&gt;.htaccess&lt;/code&gt; directives&lt;/li&gt;
&lt;li&gt;Messing with &lt;code&gt;nginx.conf&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Debugging Brotli headers manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...then trust me—&lt;strong&gt;&lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; is a dream&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Whether you’re hosting a simple portfolio, a Next.js app, a full-stack Node.js service, or a Laravel monolith, they’ve abstracted away the server complexity.&lt;/p&gt;

&lt;p&gt;Want to enable Brotli on your server? It’s literally:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login to &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; dashboard&lt;/li&gt;
&lt;li&gt;Click on your server&lt;/li&gt;
&lt;li&gt;Go to Server Settings &amp;gt; Packages&lt;/li&gt;
&lt;li&gt;Choose Brotli and apply&lt;/li&gt;
&lt;li&gt;Done&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Their hosting stack already includes Redis, Varnish, Nginx, and PHP-FPM—all layered for speed. Compression just enhances all of it.&lt;/p&gt;

&lt;p&gt;So yes, if you’ve been thinking about switching to a cloud host that’s affordable, scalable, and tuned for performance—&lt;strong&gt;now’s the time&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR – 5 Benefits Recap
&lt;/h2&gt;

&lt;p&gt;Here’s a quick summary for busy folks:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benefit                 &lt;/th&gt;
&lt;th&gt;Why It Matters                                   &lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1. Faster Load Times&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Less data = quicker rendering, even on 3G        &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;2. Better SEO&lt;/strong&gt;       &lt;/td&gt;
&lt;td&gt;Google loves fast-loading, mobile-optimized pages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;3. Lower Bandwidth&lt;/strong&gt;  &lt;/td&gt;
&lt;td&gt;Save money on data and prevent server overload   &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;4. Smoother UX&lt;/strong&gt;      &lt;/td&gt;
&lt;td&gt;Devices work less hard, users stay longer        &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;5. Easy Setup&lt;/strong&gt;       &lt;/td&gt;
&lt;td&gt;Set once, enjoy forever—especially with &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;In a world where milliseconds matter, compression isn’t optional—it’s essential.&lt;/p&gt;

&lt;p&gt;And server-side compression is one of the &lt;strong&gt;few performance optimizations&lt;/strong&gt; that require minimal effort but deliver huge rewards.&lt;/p&gt;

&lt;p&gt;Whether you’re a developer, a startup founder, or a blogger scaling your brand, this is one setting that should &lt;em&gt;never&lt;/em&gt; be left off. And if your current host makes it hard to enable, maybe it's time to move to one that makes it easy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; has earned its reputation among developers for simplifying the hard stuff—while keeping things flexible under the hood. Give it a shot and experience the difference compression (and good hosting) can make.&lt;/p&gt;

&lt;p&gt;You may also like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-benefits-of-using-worker-threads-in-node-js-455dac1e4e92" rel="noopener noreferrer"&gt;5 Benefits of Using Worker Threads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/devmap/7-best-practices-for-sanitizing-input-in-node-js-e61638440096" rel="noopener noreferrer"&gt;7 Best Practices for Sanitizing Input in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;5 AI Developer Tools to Double Your Coding Speed&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/10-essential-steps-to-organize-node-js-projects-on-cloudways-5f4bdba2eefe" rel="noopener noreferrer"&gt;10 Essential Steps to Organize Node.js Projects on Cloudways&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/what-is-geoip-rate-limiting-in-node-js-on-cloudways-3d5784448afa" rel="noopener noreferrer"&gt;What is GeoIP Rate-Limiting in Node.js on Cloudways?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;6 Common Misconceptions About Node.js Event Loop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/deploy-a-node-js-app-on-cloudways-in-10-minutes-a779cb8528b2" rel="noopener noreferrer"&gt;Deploy a Node.js App on Cloudways in 10 Minutes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-reasons-to-deep-copy-request-payloads-in-node-js-8ee6bc275ff9" rel="noopener noreferrer"&gt;5 Reasons to Deep Copy Request Payloads in Node.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/5-essential-tips-for-managing-complex-objects-in-javascript-b7cd63d52e6e" rel="noopener noreferrer"&gt;5 Essential Tips for Managing Complex Objects in JavaScript&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://article.arunangshudas.com/7-api-best-practices-every-backend-developer-should-follow-dfc10b5a9c88" rel="noopener noreferrer"&gt;7 API Best Practices Every Backend Developer Should Follow&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more blogs from &lt;strong&gt;&lt;a href="https://arunangshudas.com/blog" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can easily reach me with a &lt;strong&gt;&lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;quick call right from here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let’s discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>discuss</category>
      <category>seo</category>
      <category>performance</category>
    </item>
    <item>
      <title>Avoiding Cross-Origin Issues While Hosting Full Projects</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Mon, 23 Jun 2025 04:19:41 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/avoiding-cross-origin-issues-while-hosting-full-projects-1gi8</link>
      <guid>https://forem.com/arunangshu_das/avoiding-cross-origin-issues-while-hosting-full-projects-1gi8</guid>
      <description>&lt;p&gt;If you've ever found yourself in the middle of a web project and suddenly hit with &lt;em&gt;“CORS policy error: No 'Access-Control-Allow-Origin' header…”&lt;/em&gt;, welcome to the club. Cross-Origin Resource Sharing (CORS) issues are a rite of passage for web developers — especially when you’re hosting full-stack projects that involve separate frontend and backend deployments.&lt;/p&gt;

&lt;p&gt;Whether you’re building a personal SaaS app, running a production-grade API, or hosting a client project, &lt;strong&gt;understanding and avoiding cross-origin pitfalls&lt;/strong&gt; is critical. These small misconfigurations can bring down entire apps, frustrate users, and bloat your debug logs faster than you can say “preflight.”&lt;/p&gt;

&lt;h2&gt;
  
  
  What Exactly Is a CORS Issue?
&lt;/h2&gt;

&lt;p&gt;Let’s demystify it.&lt;/p&gt;

&lt;p&gt;CORS is a &lt;strong&gt;security feature&lt;/strong&gt; implemented by browsers to prevent rogue JavaScript from making requests to different domains without permission. It’s a good thing — in theory.&lt;/p&gt;

&lt;p&gt;But in modern full-stack web apps, we often &lt;strong&gt;intentionally split our frontend and backend&lt;/strong&gt; — sometimes across different domains, subdomains, or even entirely different servers.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend: &lt;code&gt;https://app.myproject.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Backend API: &lt;code&gt;https://api.myproject.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now when the browser on &lt;code&gt;app.myproject.com&lt;/code&gt; tries to request data from &lt;code&gt;api.myproject.com&lt;/code&gt;, it gets suspicious.&lt;/p&gt;

&lt;p&gt;Unless your API &lt;em&gt;explicitly allows&lt;/em&gt; that origin, the browser blocks the request and throws that dreaded CORS error. The request &lt;em&gt;reaches&lt;/em&gt; the server, but the browser throws it out before your code ever gets a chance to use the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frustrating?&lt;/strong&gt; Absolutely.&lt;br&gt;
&lt;strong&gt;Preventable?&lt;/strong&gt; Yes — and we’ll show you how.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Know Where Your Project Is Headed
&lt;/h2&gt;

&lt;p&gt;A common mistake developers make is designing their architecture in isolation. We code with &lt;code&gt;localhost&lt;/code&gt; in mind — where everything works fine — and forget that our final deployment might live in a very different configuration.&lt;/p&gt;

&lt;p&gt;Let’s say in development, your frontend at &lt;code&gt;localhost:3000&lt;/code&gt; talks to the backend at &lt;code&gt;localhost:5000&lt;/code&gt;. Everything works beautifully. You ship the project to production — frontend on Vercel, backend on EC2 — and boom, everything breaks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; Before you deploy, plan your deployment architecture.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Will frontend and backend live on the same domain?&lt;/li&gt;
&lt;li&gt;Will you use subdomains like &lt;code&gt;api.myapp.com&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;Are you serving both frontend and backend from the same server?&lt;/li&gt;
&lt;li&gt;Will you use a reverse proxy or CDN like Cloudflare?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sketch that out early. A good deployment plan is half the CORS battle won.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Properly Set CORS Headers on Your Backend
&lt;/h2&gt;

&lt;p&gt;This is the most straightforward fix — and often the most overlooked. Your backend &lt;strong&gt;must&lt;/strong&gt; tell the browser which origins are allowed to talk to it.&lt;/p&gt;
&lt;h3&gt;
  
  
  In Node.js (Express.js):
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cors&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;corsOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://yourfrontenddomain.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;// or '*', or regex&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET,POST,PUT,DELETE&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;corsOptions&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Never use &lt;code&gt;"*"&lt;/code&gt; for &lt;code&gt;origin&lt;/code&gt; in production if you’re dealing with credentials (cookies or auth tokens).&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;credentials: true&lt;/code&gt; &lt;strong&gt;only&lt;/strong&gt; when cookies or HTTP auth is involved — and make sure the client also sends &lt;code&gt;credentials: "include”&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  For Nginx Backends:
&lt;/h3&gt;

&lt;p&gt;If you're reverse-proxying through Nginx, add this to your config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/api/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;'Access-Control-Allow-Origin'&lt;/span&gt; &lt;span class="s"&gt;'https://yourfrontenddomain.com'&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;'Access-Control-Allow-Methods'&lt;/span&gt; &lt;span class="s"&gt;'GET,&lt;/span&gt; &lt;span class="s"&gt;POST,&lt;/span&gt; &lt;span class="s"&gt;OPTIONS'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;'Access-Control-Allow-Headers'&lt;/span&gt; &lt;span class="s"&gt;'Origin,&lt;/span&gt; &lt;span class="s"&gt;Content-Type,&lt;/span&gt; &lt;span class="s"&gt;Accept,&lt;/span&gt; &lt;span class="s"&gt;Authorization'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;'Access-Control-Allow-Credentials'&lt;/span&gt; &lt;span class="s"&gt;'true'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; 
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="s"&gt;if&lt;/span&gt; &lt;span class="s"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$request_method&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;OPTIONS&lt;/span&gt; &lt;span class="s"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;204&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test thoroughly. Even one missing header can make browsers freak out.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Understand Preflight Requests
&lt;/h2&gt;

&lt;p&gt;Here’s where many developers get tripped up. Some requests trigger a &lt;strong&gt;“preflight”&lt;/strong&gt; — an OPTIONS request that asks the server “Hey, can I do this POST request with a JSON body?”&lt;/p&gt;

&lt;p&gt;If your server doesn’t respond properly to the OPTIONS request, &lt;strong&gt;the main request is never sent&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preflight Happens When:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You use methods like &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;, &lt;code&gt;PATCH&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You send custom headers (like &lt;code&gt;Authorization&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;You send JSON or non-simple content types&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Make sure your backend handles OPTIONS requests&lt;/strong&gt; gracefully and returns the appropriate headers.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Using a Reverse Proxy to Avoid CORS Altogether
&lt;/h2&gt;

&lt;p&gt;One clever way to avoid CORS is… to not trigger it at all.&lt;/p&gt;

&lt;p&gt;If you serve both frontend and backend from the same domain — or route API calls through a proxy — the browser won’t consider them cross-origin.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: Nginx Proxy Setup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="s"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;myproject.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt; &lt;/span&gt;
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="s"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt; &lt;span class="n"&gt;/var/www/frontend&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;index&lt;/span&gt; &lt;span class="s"&gt;index.html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="s"&gt; &lt;/span&gt;
&lt;span class="s"&gt;   &lt;/span&gt; &lt;span class="s"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/api/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://localhost:5000/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;proxy_http_version&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;       &lt;/span&gt; &lt;span class="s"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Real-IP&lt;/span&gt; &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;   &lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your frontend fetches &lt;code&gt;/api/data&lt;/code&gt;, which internally maps to your backend — &lt;strong&gt;no CORS ever triggered&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Host on a Platform That Supports Full-Stack Project Logic
&lt;/h2&gt;

&lt;p&gt;And here’s where infrastructure choices really start to matter.&lt;/p&gt;

&lt;p&gt;If your hosting provider &lt;strong&gt;limits you to just frontend&lt;/strong&gt; or lacks easy backend configuration, you’re going to jump through hoops.&lt;/p&gt;

&lt;h3&gt;
  
  
  What You Need:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom domain support&lt;/strong&gt; (not just auto-generated URLs)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend deployment&lt;/strong&gt; (Node.js, Python, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment variables&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server-level config (Nginx/Apache)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subdomain or wildcard SSL&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Team-level collaboration&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why platforms like &lt;strong&gt;&lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;&lt;/strong&gt; shine here. They’re developer-first but &lt;em&gt;not&lt;/em&gt; DevOps-heavy. You can deploy a Node.js backend, set up a frontend (or host it via S3/Netlify), point a domain, and configure all your headers and firewall settings without wrangling dozens of terminal commands.&lt;/p&gt;

&lt;p&gt;You’re in control, but you’re not alone.&lt;/p&gt;

&lt;p&gt;Plus, their platform makes it super simple to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set custom CORS headers via Nginx&lt;/li&gt;
&lt;li&gt;Add SSL to multiple subdomains&lt;/li&gt;
&lt;li&gt;Scale your backend resources with just a click&lt;/li&gt;
&lt;li&gt;Run background workers, cron jobs, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All without needing to manage the chaos of EC2 or worry about cold starts like in serverless.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Debug Smartly: Tools and Tricks
&lt;/h2&gt;

&lt;p&gt;CORS bugs can be tough because they often don’t show up in the backend logs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use These:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Browser DevTools → Network tab&lt;/strong&gt;: Check the OPTIONS preflight and see the response headers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postman or curl&lt;/strong&gt;: Doesn’t trigger CORS, but good for backend logic validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CORS proxy testing&lt;/strong&gt;: Temporarily test via a proxy like &lt;a href="https://cors-anywhere.herokuapp.com/" rel="noopener noreferrer"&gt;https://cors-anywhere.herokuapp.com/&lt;/a&gt; (but never use in production)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Online tools&lt;/strong&gt; like &lt;a href="https://test-cors.org/" rel="noopener noreferrer"&gt;Test CORS&lt;/a&gt; or &lt;a href="https://www.test-cors.org/whitelist" rel="noopener noreferrer"&gt;Whitelisted Domains Checker&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And always test in both Chrome and Firefox — they have slightly different CORS enforcement nuances.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Bonus: Cookie-Based Auth + CORS = Headache
&lt;/h2&gt;

&lt;p&gt;If your app uses &lt;strong&gt;cookies for auth&lt;/strong&gt; (common with session-based Node.js apps), you’ll need to ensure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The frontend sets &lt;code&gt;credentials: 'include'&lt;/code&gt; on fetch or axios&lt;/li&gt;
&lt;li&gt;The backend sets &lt;code&gt;Access-Control-Allow-Credentials: true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The origin is &lt;strong&gt;not&lt;/strong&gt; &lt;code&gt;*&lt;/code&gt;, but explicitly listed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, ensure your cookies are marked as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;Set-Cookie: session_id=abc123; Secure; SameSite=None
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;SameSite=None&lt;/code&gt; isn’t set, most browsers won’t send cross-site cookies.&lt;/p&gt;

&lt;p&gt;Again — getting this right is simpler when your hosting provider doesn’t limit your server headers, proxy setups, or cookie scope. That’s why I lean towards flexible hosts like &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; for these real-world production setups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;CORS issues aren’t a bug — they’re a feature.&lt;/p&gt;

&lt;p&gt;But that doesn’t mean they’re not frustrating, confusing, or downright rage-inducing when you’re trying to ship a product.&lt;/p&gt;

&lt;p&gt;The good news? With a solid understanding of how it works, and a few well-placed configuration tweaks, &lt;strong&gt;you can banish CORS errors from your logs forever.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even better — you can &lt;strong&gt;prevent them entirely&lt;/strong&gt; with smarter project architecture and by choosing a host that plays well with full-stack deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoiding CORS in Production
&lt;/h2&gt;

&lt;p&gt;→ Plan your domain/subdomain structure early&lt;br&gt;
→ Explicitly configure CORS on your backend&lt;br&gt;
→ Handle OPTIONS requests for preflight&lt;br&gt;
→ Avoid CORS with same-origin proxy setups&lt;br&gt;
→ Use a hosting provider like &lt;a href="https://www.cloudways.com/en/?id=1964204" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt; that supports full control&lt;br&gt;
→ Debug with DevTools, Postman, and test environments&lt;br&gt;
→ Be extra careful with cookies and credentials&lt;br&gt;
→ Document everything for future devs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You may also like:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Large Companies Using Node.js for Backend&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/why-85-of-developers-use-express-js-wrongly-8c9c6f380fce" rel="noopener noreferrer"&gt;&lt;strong&gt;Why 85% of Developers Use Express.js Wrongly&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-node-js-middleware-for-efficient-coding-5ab0b0e82ea0" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Node.js Middleware for Efficient Coding&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-key-differences-worker-threads-vs-child-processes-in-node-js-5259a35a687a" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Key Differences: Worker Threads vs Child Processes in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-effective-caching-strategies-for-node-js-applications-bb9ac30c69d0" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Effective Caching Strategies for Node.js Applications&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-mongoose-performance-mistakes-that-slow-your-app-e204577b90f5" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Mongoose Performance Mistakes That Slow Your App&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/building-your-own-mini-load-balancer-in-node-js-yes-you-can-09157bb3ff4f" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Your Own Mini Load Balancer in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-tips-for-serverless-nodejs-api-deployment-448n"&gt;&lt;strong&gt;7 Tips for Serverless Node.js API Deployment&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-host-a-mongoose-powered-app-on-flyio-4fpk"&gt;&lt;strong&gt;How to Host a Mongoose-Powered App on Fly.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/the-real-reason-node-js-is-so-fast-its-all-about-concurrency-b3d71b432c1f" rel="noopener noreferrer"&gt;&lt;strong&gt;The Real Reason Node.js Is So Fast&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-must-know-node-js-patterns-for-application-growth-a1b5fac9d047" rel="noopener noreferrer"&gt;&lt;strong&gt;10 Must-Know Node.js Patterns for Application Growth&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-deploy-a-dockerized-nodejs-app-on-google-cloud-run-4i0i"&gt;&lt;strong&gt;How to Deploy a Dockerized Node.js App on Google Cloud Run&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arunangshudas.com/blog/can-node-js-handle-millions-of-users/" rel="noopener noreferrer"&gt;&lt;strong&gt;Can Node.js Handle Millions of Users?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-mistakes-every-beginner-node-js-developer-makes-fccff256c0e5" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Deploy a Node.js App on Vercel&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;&lt;strong&gt;6 Common Misconceptions About Node.js Event Loop&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-common-garbage-collection-issues-in-nodejs-jm1"&gt;&lt;strong&gt;7 Common Garbage Collection Issues in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-do-i-fix-performance-bottlenecks-in-nodejs-5e76"&gt;&lt;strong&gt;How Do I Fix Performance Bottlenecks in Node.js?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/what-are-the-advantages-of-serverless-nodejs-solutions-4p7d"&gt;&lt;strong&gt;What Are the Advantages of Serverless Node.js Solutions?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/high-traffic-node-js-strategies-for-success-ab4908c8dfc0" rel="noopener noreferrer"&gt;&lt;strong&gt;High-Traffic Node.js: Strategies for Success&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Read more blogs from&lt;/strong&gt; &lt;a href="https://blog.arunangshudas.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can easily reach me with a&lt;/strong&gt; &lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;&lt;strong&gt;quick call right from here.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let's discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me on&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
      <category>browser</category>
    </item>
    <item>
      <title>6 AI APIs That Can Help You Build a SaaS in a Weekend</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Fri, 20 Jun 2025 02:57:33 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/6-ai-apis-that-can-help-you-build-a-saas-in-a-weekend-3e8p</link>
      <guid>https://forem.com/arunangshu_das/6-ai-apis-that-can-help-you-build-a-saas-in-a-weekend-3e8p</guid>
      <description>&lt;p&gt;Let’s be honest: &lt;strong&gt;building a SaaS used to take months.&lt;/strong&gt; Now, with the rise of AI APIs, you can go from idea to MVP over a weekend. Yes — a real, working product that solves a problem and even has a "wow" factor.&lt;/p&gt;

&lt;p&gt;Whether you're building a marketing tool, a content generator, a smart analytics app, or something unique — AI APIs are your best bet to add serious power, fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why AI APIs?
&lt;/h2&gt;

&lt;p&gt;Before diving into the tools, let’s look at why AI APIs are &lt;em&gt;the&lt;/em&gt; foundation for fast SaaS MVPs today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No AI/ML knowledge required&lt;/strong&gt; – You don’t need to train models. Just plug in and go.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Battle-tested infrastructure&lt;/strong&gt; – Most APIs come with reliable uptime, documentation, and support.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalable from MVP to production&lt;/strong&gt; – Start small, then upgrade as traffic grows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Insanely creative potential&lt;/strong&gt; – From summarization to speech, vision, and beyond — the sky’s the limit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You no longer have to be an AI researcher. You just have to be a smart builder.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack You’ll Likely Use
&lt;/h2&gt;

&lt;p&gt;Before we list the APIs, here’s a typical weekend-ready stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React + Tailwind or Next.js&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Node.js + Express or serverless (Vercel/Cloudflare Workers)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt;: Firebase / Supabase / MongoDB Atlas&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deployment&lt;/strong&gt;: Vercel, Railway, or Render&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auth&lt;/strong&gt;: Clerk, Supabase Auth, or Firebase Auth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let’s plug AI into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;OpenAI API&lt;/strong&gt; – The Swiss Army Knife for SaaS
&lt;/h2&gt;

&lt;p&gt;If you could only pick one AI API to build with, this is it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Natural language generation (chatbots, email writers, idea generators)&lt;/li&gt;
&lt;li&gt;Code generation and debugging&lt;/li&gt;
&lt;li&gt;Summarization, translation, Q&amp;amp;A&lt;/li&gt;
&lt;li&gt;Custom GPTs (via OpenAI Assistants API)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SaaS Ideas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Helpdesk&lt;/strong&gt;: User types a question → GPT answers using your support docs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Wizard&lt;/strong&gt;: Blog title → full draft + image suggestions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Startup Idea Generator&lt;/strong&gt;: From niche + market to branding + pitch copy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.openai.com/v1/chat/completions&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gpt-4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Write a product description for an AI-powered calendar.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why It’s Weekend-Ready
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Dead-simple to integrate&lt;/li&gt;
&lt;li&gt;Handles 90% of use cases out of the box&lt;/li&gt;
&lt;li&gt;Tons of SDKs and community support&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. &lt;strong&gt;Stability AI (Stable Diffusion API)&lt;/strong&gt; – Generate Images On-Demand
&lt;/h2&gt;

&lt;p&gt;Need AI-generated graphics, thumbnails, avatars, or social media creatives? Use Stable Diffusion via the Stability API.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Text-to-image generation&lt;/li&gt;
&lt;li&gt;Control image size, style, model (SDXL, SD 1.5, etc.)&lt;/li&gt;
&lt;li&gt;Instant visual content for SaaS, blogs, e-commerce, and more&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SaaS Ideas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Product Mockups&lt;/strong&gt;: Input product description → get realistic image&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instagram Post Generator&lt;/strong&gt;: Headline → branded graphic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Avatar Creator&lt;/strong&gt;: Upload a photo → style transformation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://api.stability.ai/v2beta/stable-image/generate/core"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer YOUR_API_KEY"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"prompt":"A modern SaaS dashboard, isometric style","output_format":"png"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why It’s Weekend-Ready
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Easy to get API key and test&lt;/li&gt;
&lt;li&gt;Fast response times for MVPs&lt;/li&gt;
&lt;li&gt;Saves thousands in design work&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. &lt;strong&gt;AssemblyAI&lt;/strong&gt; – Turn Audio to Text, Fast
&lt;/h2&gt;

&lt;p&gt;Need transcription, speaker diarization, sentiment analysis, or AI summaries of meetings? AssemblyAI is a top choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Transcribes audio/video into text&lt;/li&gt;
&lt;li&gt;Detects speakers, sentiment, keywords&lt;/li&gt;
&lt;li&gt;Summarizes long conversations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SaaS Ideas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Podcast Notes Generator&lt;/strong&gt;: Upload podcast → get timestamped summary&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Meeting Recorder&lt;/strong&gt;: Zoom/Meet recording → auto transcription + highlights&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice Support Logger&lt;/strong&gt;: Auto-document every customer call&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;transcriptRes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.assemblyai.com/v2/transcript&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="na"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_API_KEY&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;content-type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;audio_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://your-audio-url.mp3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transcriptRes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why It’s Weekend-Ready
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Upload or link an audio file&lt;/li&gt;
&lt;li&gt;Text comes back fast&lt;/li&gt;
&lt;li&gt;Docs are clear and minimal&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;ElevenLabs&lt;/strong&gt; – AI Voice That Sounds Human
&lt;/h2&gt;

&lt;p&gt;Want to add voice generation to your SaaS? ElevenLabs offers some of the most realistic AI speech synthesis.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Text-to-speech with multiple voices, emotions&lt;/li&gt;
&lt;li&gt;Clone your own voice&lt;/li&gt;
&lt;li&gt;Multilingual support&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SaaS Ideas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Voiceover Tool&lt;/strong&gt;: Create product videos, training, or YouTube shorts from text&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audio News App&lt;/strong&gt;: Turn blog feeds into podcast-like audio&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility SaaS&lt;/strong&gt;: Read out loud any web content&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"xi-api-key: YOUR_API_KEY"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
         "text": "Welcome to your AI-powered dashboard.",
         "voice_settings": { "stability": 0.5, "similarity_boost": 0.5 }
     }'&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; output.mp3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why It’s Weekend-Ready
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Easy to try with free credits&lt;/li&gt;
&lt;li&gt;High-quality speech without tuning&lt;/li&gt;
&lt;li&gt;Adds instant "premium" feel to your SaaS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;Mindee&lt;/strong&gt; – Parse Documents With AI (Invoices, Receipts, etc.)
&lt;/h2&gt;

&lt;p&gt;Mindee turns documents like receipts and invoices into structured JSON data — ideal for automation-heavy SaaS apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Extract structured data from scanned documents&lt;/li&gt;
&lt;li&gt;Pre-trained for invoices, receipts, IDs, etc.&lt;/li&gt;
&lt;li&gt;OCR + AI = real-world applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SaaS Ideas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bookkeeping Automation SaaS&lt;/strong&gt;: Drag &amp;amp; drop invoices → data to Google Sheets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expense Tracker&lt;/strong&gt;: Scan receipt → auto categorize + track&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding Doc Extractor&lt;/strong&gt;: Pull info from forms or IDs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://api.mindee.net/v1/products/mindee/invoice/v1/predict &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Token YOUR_API_KEY"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="nv"&gt;document&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;@path_to_invoice.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why It’s Weekend-Ready
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No model training needed&lt;/li&gt;
&lt;li&gt;Easily plug into forms or uploads&lt;/li&gt;
&lt;li&gt;Works with just a few lines of code&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. &lt;strong&gt;LangChain + Vector DB (Pinecone/Weaviate)&lt;/strong&gt; – Build Your Own ChatGPT With Custom Knowledge
&lt;/h2&gt;

&lt;p&gt;This combo lets you create an AI chatbot trained on your own content — PDF manuals, Notion docs, FAQs, websites, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Custom Q&amp;amp;A from your content&lt;/li&gt;
&lt;li&gt;Contextual, memory-based chats&lt;/li&gt;
&lt;li&gt;Combine with OpenAI or Anthropic for LLM backend&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SaaS Ideas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Tutor App&lt;/strong&gt;: Upload course PDFs → personalized study chatbot&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internal Knowledge Assistant&lt;/strong&gt;: Train AI on company wiki&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customer Success Bot&lt;/strong&gt;: AI that &lt;em&gt;actually&lt;/em&gt; understands your product&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It (simplified flow)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Use LangChain to split &amp;amp; embed documents&lt;/li&gt;
&lt;li&gt;Store vectors in Pinecone/Weaviate&lt;/li&gt;
&lt;li&gt;Query via similarity + LLM
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.embeddings&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAIEmbeddings&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.vectorstores&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Pinecone&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.document_loaders&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PyPDFLoader&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.chains&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;RetrievalQA&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.chat_models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ChatOpenAI&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="n"&gt;loader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PyPDFLoader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user_manual.pdf&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;docs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;loader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pinecone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;docs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;OpenAIEmbeddings&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;index_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;my-index&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="n"&gt;qa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;RetrievalQA&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_chain_type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;ChatOpenAI&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;retriever&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_retriever&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;qa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;How do I reset the product?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why It’s Weekend-Ready
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rich ecosystem, tutorials, boilerplates&lt;/li&gt;
&lt;li&gt;Production-ready vector DBs like Pinecone, Weaviate&lt;/li&gt;
&lt;li&gt;Turns your SaaS into an intelligent app overnight&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bonus: API Integration Tips for a Smooth Weekend MVP
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use environment variables&lt;/strong&gt; for API keys (&lt;code&gt;dotenv&lt;/code&gt; in Node.js)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use retry + error logging&lt;/strong&gt; — many APIs have rate limits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache responses&lt;/strong&gt; if data doesn’t change (e.g., using Redis or localStorage)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always display loading states&lt;/strong&gt; — AI calls take a few seconds&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limit user input tokens&lt;/strong&gt; — to avoid overcharges&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts: AI Is the Shortcut — Not the Limitation
&lt;/h2&gt;

&lt;p&gt;The tools above are not just for experimentation — they’re used by real-world SaaS companies today. But the magic is how you &lt;em&gt;combine&lt;/em&gt; them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You may also like:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Large Companies Using Node.js for Backend&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/why-85-of-developers-use-express-js-wrongly-8c9c6f380fce" rel="noopener noreferrer"&gt;&lt;strong&gt;Why 85% of Developers Use Express.js Wrongly&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-node-js-middleware-for-efficient-coding-5ab0b0e82ea0" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Node.js Middleware for Efficient Coding&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-key-differences-worker-threads-vs-child-processes-in-node-js-5259a35a687a" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Key Differences: Worker Threads vs Child Processes in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-effective-caching-strategies-for-node-js-applications-bb9ac30c69d0" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Effective Caching Strategies for Node.js Applications&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-mongoose-performance-mistakes-that-slow-your-app-e204577b90f5" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Mongoose Performance Mistakes That Slow Your App&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/building-your-own-mini-load-balancer-in-node-js-yes-you-can-09157bb3ff4f" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Your Own Mini Load Balancer in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-tips-for-serverless-nodejs-api-deployment-448n"&gt;&lt;strong&gt;7 Tips for Serverless Node.js API Deployment&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-host-a-mongoose-powered-app-on-flyio-4fpk"&gt;&lt;strong&gt;How to Host a Mongoose-Powered App on Fly.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/the-real-reason-node-js-is-so-fast-its-all-about-concurrency-b3d71b432c1f" rel="noopener noreferrer"&gt;&lt;strong&gt;The Real Reason Node.js Is So Fast&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-must-know-node-js-patterns-for-application-growth-a1b5fac9d047" rel="noopener noreferrer"&gt;&lt;strong&gt;10 Must-Know Node.js Patterns for Application Growth&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-deploy-a-dockerized-nodejs-app-on-google-cloud-run-4i0i"&gt;&lt;strong&gt;How to Deploy a Dockerized Node.js App on Google Cloud Run&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arunangshudas.com/blog/can-node-js-handle-millions-of-users/" rel="noopener noreferrer"&gt;&lt;strong&gt;Can Node.js Handle Millions of Users?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-mistakes-every-beginner-node-js-developer-makes-fccff256c0e5" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Deploy a Node.js App on Vercel&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;&lt;strong&gt;6 Common Misconceptions About Node.js Event Loop&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-common-garbage-collection-issues-in-nodejs-jm1"&gt;&lt;strong&gt;7 Common Garbage Collection Issues in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-do-i-fix-performance-bottlenecks-in-nodejs-5e76"&gt;&lt;strong&gt;How Do I Fix Performance Bottlenecks in Node.js?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/what-are-the-advantages-of-serverless-nodejs-solutions-4p7d"&gt;&lt;strong&gt;What Are the Advantages of Serverless Node.js Solutions?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/high-traffic-node-js-strategies-for-success-ab4908c8dfc0" rel="noopener noreferrer"&gt;&lt;strong&gt;High-Traffic Node.js: Strategies for Success&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Read more blogs from&lt;/strong&gt; &lt;a href="https://blog.arunangshudas.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can easily reach me with a&lt;/strong&gt; &lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;&lt;strong&gt;quick call right from here.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let's discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me on&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>restapi</category>
      <category>saas</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>5 Reasons Your Express App Is Running Slowly</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Wed, 18 Jun 2025 03:51:39 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/5-reasons-your-express-app-is-running-slowly-5g1c</link>
      <guid>https://forem.com/arunangshu_das/5-reasons-your-express-app-is-running-slowly-5g1c</guid>
      <description>&lt;p&gt;Express.js is the go-to web framework for Node.js developers—and for good reason. It's minimal, unopinionated, fast, and easy to learn. But once your app starts growing, you may begin noticing performance issues. Routes take longer to respond, memory usage climbs, and your once snappy API starts to feel sluggish.&lt;/p&gt;

&lt;p&gt;If you've been scratching your head, wondering why your Express app isn’t performing as expected, you're not alone. Performance bottlenecks creep in silently and often stem from common pitfalls that developers—especially in fast-paced environments—don’t notice until the app hits production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason 1: &lt;strong&gt;Blocking the Event Loop&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Node.js is single-threaded and uses an event-driven model to handle concurrency. This means your entire application can grind to a halt if you accidentally write blocking (synchronous) code in any part of the request/response cycle.&lt;/p&gt;

&lt;p&gt;Some common culprits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU-intensive operations (e.g., image processing, complex calculations)&lt;/li&gt;
&lt;li&gt;Synchronous file system access&lt;/li&gt;
&lt;li&gt;Poorly optimized loops or recursive functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your route handler is performing heavy computation or waiting on a blocking function, it can &lt;strong&gt;freeze the entire server&lt;/strong&gt;, not just the current request.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Identify:
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;clinic.js&lt;/code&gt; tool (especially &lt;code&gt;clinic doctor&lt;/code&gt;) to identify event loop lag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; clinic
clinic doctor &lt;span class="nt"&gt;--&lt;/span&gt; node app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use &lt;code&gt;process.hrtime()&lt;/code&gt; or &lt;code&gt;async_hooks&lt;/code&gt; to manually track lag.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Offload CPU-heavy tasks to a worker thread or external service.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;fs.promises&lt;/code&gt; or asynchronous versions of APIs.&lt;/li&gt;
&lt;li&gt;Consider &lt;code&gt;bull&lt;/code&gt; + Redis for job queues.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;child_process&lt;/code&gt; or &lt;code&gt;worker_threads&lt;/code&gt; for isolated, heavy tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Bad (Blocking)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/slow&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./large-file.txt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// blocking&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Good (Non-blocking)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/fast&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;promises&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./large-file.txt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reason 2: &lt;strong&gt;Unoptimized Middleware Stack&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Middleware in Express is executed in order—one by one. If you load too many unnecessary or poorly optimized middlewares on every request, you’re bound to slow things down.&lt;/p&gt;

&lt;p&gt;Even worse, some middleware (like &lt;code&gt;body-parser&lt;/code&gt;) may parse large bodies even when they’re not needed, wasting precious CPU time.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Identify:
&lt;/h3&gt;

&lt;p&gt;Log middleware execution times using a custom middleware or profiling tool like &lt;code&gt;morgan&lt;/code&gt;, &lt;code&gt;express-status-monitor&lt;/code&gt;, or &lt;code&gt;clinic&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;finish&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;method&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; took &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;ms`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Fix:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Apply middleware &lt;strong&gt;only where necessary&lt;/strong&gt; using route-level usage.&lt;/li&gt;
&lt;li&gt;Avoid using heavy middleware globally unless it’s essential.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;compression&lt;/code&gt; and &lt;code&gt;helmet&lt;/code&gt; wisely—turn them off in dev mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Bad: Global middleware for everything&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bodyParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// applied even on GET requests&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Good: Scoped middleware&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/health&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OK&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// no middleware needed here&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bodyParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c1"&gt;// only parse body here&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reason 3: &lt;strong&gt;Slow or Inefficient Database Queries&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Even the most optimized Express app will crawl if your database calls are slow or unindexed. Common issues include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;N+1 queries&lt;/li&gt;
&lt;li&gt;Missing indexes&lt;/li&gt;
&lt;li&gt;Inefficient joins&lt;/li&gt;
&lt;li&gt;Fetching too much data (no pagination or projections)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since database calls are typically I/O-bound, poor performance here creates a domino effect.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Identify:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use tools like &lt;strong&gt;Mongoose Debug&lt;/strong&gt;, &lt;strong&gt;Sequelize logging&lt;/strong&gt;, or query profilers.&lt;/li&gt;
&lt;li&gt;Log query times manually.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;debug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Fix:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Indexes&lt;/strong&gt;: Ensure that frequently queried fields are indexed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paginate&lt;/strong&gt;: Always paginate when dealing with large datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize Queries&lt;/strong&gt;: Fetch only required fields using projection/select.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Bad: Fetching all fields without pagination&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// no limit or select&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Good: Paginated and projected&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;skip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Bonus:
&lt;/h3&gt;

&lt;p&gt;If you're using MongoDB, use the &lt;strong&gt;Aggregation Pipeline&lt;/strong&gt; smartly to do in-DB transformations and avoid bloating your Node.js server with processing logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason 4: &lt;strong&gt;No Caching Layer&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;If you're hitting your database or third-party APIs on every single request, you're wasting resources and introducing latency.&lt;/p&gt;

&lt;p&gt;Even static content like config, user sessions, or metadata can and should be cached.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Identify:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Notice repeated DB/API calls for the same data in a short time.&lt;/li&gt;
&lt;li&gt;Monitor request durations for static pages or repeat visits.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Fix:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Memory Caching&lt;/strong&gt;: Use &lt;code&gt;node-cache&lt;/code&gt; or &lt;code&gt;memory-cache&lt;/code&gt; for small apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distributed Caching&lt;/strong&gt;: Use Redis for multi-instance or clustered apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache Headers&lt;/strong&gt;: Leverage HTTP caching (ETags, Cache-Control).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example using Redis:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;redis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/profile/:id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// cache for 1 hour&lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reason 5: &lt;strong&gt;Large Payloads and Uncompressed Responses&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Transferring large payloads without compression can be brutal on both server and client—especially on mobile networks or when dealing with JSON-heavy APIs.&lt;/p&gt;

&lt;p&gt;Even more so when users are sending large file uploads or form data without limits set.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Identify:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Look at network payload sizes via browser dev tools.&lt;/li&gt;
&lt;li&gt;Use tools like &lt;code&gt;Postman&lt;/code&gt; to inspect response headers and sizes.&lt;/li&gt;
&lt;li&gt;Audit Express logs or middleware metrics.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Fix:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;compression&lt;/code&gt; middleware (gzip or brotli).&lt;/li&gt;
&lt;li&gt;Limit payload size in body-parser or multer.&lt;/li&gt;
&lt;li&gt;Avoid over-fetching (don’t send the entire user object if only &lt;code&gt;email&lt;/code&gt; is needed).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;compression&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;compression&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;compression&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// gzip all responses&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bodyParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1mb&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt; &lt;span class="c1"&gt;// prevent large payload attacks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, when serving static files, precompress assets and serve &lt;code&gt;.gz&lt;/code&gt; versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tips for Speeding Up Express Apps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Cluster Mode&lt;/strong&gt;&lt;br&gt;
   Leverage all CPU cores using &lt;code&gt;PM2&lt;/code&gt; or the native &lt;code&gt;cluster&lt;/code&gt; module.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lazy Load Routes&lt;/strong&gt;&lt;br&gt;
   For large applications, split routes into smaller modules and load them only when needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid Memory Leaks&lt;/strong&gt;&lt;br&gt;
   Use &lt;code&gt;heapdump&lt;/code&gt;, &lt;code&gt;leakage&lt;/code&gt;, or &lt;code&gt;memwatch&lt;/code&gt; to profile your app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use CDN for Static Assets&lt;/strong&gt;&lt;br&gt;
   Offload images, JS, and CSS to a CDN instead of serving from the same server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use async/await everywhere&lt;/strong&gt;&lt;br&gt;
   Keep your code non-blocking and easier to manage.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Slow Express apps are not usually caused by the framework itself—it’s almost always in how it’s used. When you're working with real users and real traffic, ignoring performance becomes expensive quickly.&lt;/p&gt;

&lt;p&gt;With tools, logs, and conscious design patterns, these problems can be fixed—often with just a few lines of code.&lt;/p&gt;

&lt;p&gt;→ Use async patterns&lt;br&gt;
→ Optimize middleware&lt;br&gt;
→ Streamline database access&lt;br&gt;
→ Implement caching&lt;br&gt;
→ Compress everything&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You may also like:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Large Companies Using Node.js for Backend&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/why-85-of-developers-use-express-js-wrongly-8c9c6f380fce" rel="noopener noreferrer"&gt;&lt;strong&gt;Why 85% of Developers Use Express.js Wrongly&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-node-js-middleware-for-efficient-coding-5ab0b0e82ea0" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Node.js Middleware for Efficient Coding&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-key-differences-worker-threads-vs-child-processes-in-node-js-5259a35a687a" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Key Differences: Worker Threads vs Child Processes in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-effective-caching-strategies-for-node-js-applications-bb9ac30c69d0" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Effective Caching Strategies for Node.js Applications&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-mongoose-performance-mistakes-that-slow-your-app-e204577b90f5" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Mongoose Performance Mistakes That Slow Your App&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/building-your-own-mini-load-balancer-in-node-js-yes-you-can-09157bb3ff4f" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Your Own Mini Load Balancer in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-tips-for-serverless-nodejs-api-deployment-448n"&gt;&lt;strong&gt;7 Tips for Serverless Node.js API Deployment&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-host-a-mongoose-powered-app-on-flyio-4fpk"&gt;&lt;strong&gt;How to Host a Mongoose-Powered App on Fly.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/the-real-reason-node-js-is-so-fast-its-all-about-concurrency-b3d71b432c1f" rel="noopener noreferrer"&gt;&lt;strong&gt;The Real Reason Node.js Is So Fast&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-must-know-node-js-patterns-for-application-growth-a1b5fac9d047" rel="noopener noreferrer"&gt;&lt;strong&gt;10 Must-Know Node.js Patterns for Application Growth&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-deploy-a-dockerized-nodejs-app-on-google-cloud-run-4i0i"&gt;&lt;strong&gt;How to Deploy a Dockerized Node.js App on Google Cloud Run&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arunangshudas.com/blog/can-node-js-handle-millions-of-users/" rel="noopener noreferrer"&gt;&lt;strong&gt;Can Node.js Handle Millions of Users?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-mistakes-every-beginner-node-js-developer-makes-fccff256c0e5" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Deploy a Node.js App on Vercel&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;&lt;strong&gt;6 Common Misconceptions About Node.js Event Loop&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-common-garbage-collection-issues-in-nodejs-jm1"&gt;&lt;strong&gt;7 Common Garbage Collection Issues in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-do-i-fix-performance-bottlenecks-in-nodejs-5e76"&gt;&lt;strong&gt;How Do I Fix Performance Bottlenecks in Node.js?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/what-are-the-advantages-of-serverless-nodejs-solutions-4p7d"&gt;&lt;strong&gt;What Are the Advantages of Serverless Node.js Solutions?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/high-traffic-node-js-strategies-for-success-ab4908c8dfc0" rel="noopener noreferrer"&gt;&lt;strong&gt;High-Traffic Node.js: Strategies for Success&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Read more blogs from&lt;/strong&gt; &lt;a href="https://blog.arunangshudas.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can easily reach me with a&lt;/strong&gt; &lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;&lt;strong&gt;quick call right from here.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let's discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me on&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
      <category>express</category>
    </item>
    <item>
      <title>85% of Developers Misuse This One AWS Feature</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Tue, 17 Jun 2025 03:30:00 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/85-of-developers-misuse-this-one-aws-feature-1740</link>
      <guid>https://forem.com/arunangshu_das/85-of-developers-misuse-this-one-aws-feature-1740</guid>
      <description>&lt;p&gt;&lt;strong&gt;“It’s just S3. What could go wrong?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’ve ever had this thought while deploying an app, building a static site, storing user uploads, or integrating backups, you're not alone. But you might also be unknowingly misusing one of the most powerful — and deceptively simple — services in the AWS ecosystem: &lt;strong&gt;Amazon S3 (Simple Storage Service)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Yes, &lt;strong&gt;S3&lt;/strong&gt; — the Swiss Army knife of AWS.&lt;/p&gt;

&lt;p&gt;It sounds harmless, even elegant: a “bucket” where you store your files. But the truth is, &lt;strong&gt;most developers (up to 85%) are not using S3 the right way&lt;/strong&gt;, especially at scale or in production-grade applications.&lt;/p&gt;

&lt;p&gt;From skyrocketing costs, broken performance, misconfigured security, to compliance nightmares — the misuse of S3 creates hidden dangers that quietly eat away at your infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Misunderstood Simplicity: Why S3 Gets Abused So Often
&lt;/h2&gt;

&lt;p&gt;The beauty and danger of S3 is its simplicity.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Just create a bucket and upload your stuff. Done.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s the mentality. And to be fair, AWS doesn’t help much. The S3 console is so easy to use that you don’t feel like you’re touching something powerful.&lt;/p&gt;

&lt;p&gt;But here's the catch: &lt;strong&gt;S3 is an enterprise-grade service pretending to be beginner-friendly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And that’s why it gets misused.&lt;/p&gt;

&lt;p&gt;You don’t realize how deep the rabbit hole goes until your bill spikes, your app slows down, or you suffer a breach due to a public bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Misuse #1: &lt;strong&gt;Buckets Left Public “for Testing”&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;One of the most common S3 misuse patterns is leaving a bucket public for quick testing or uploads… and forgetting about it.&lt;/p&gt;

&lt;p&gt;Developers do this to get things done fast:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws s3api put-bucket-acl &lt;span class="nt"&gt;--bucket&lt;/span&gt; my-bucket &lt;span class="nt"&gt;--acl&lt;/span&gt; public-read
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom. Your bucket is now public.&lt;/p&gt;

&lt;p&gt;Except that it's now &lt;strong&gt;available to the entire internet&lt;/strong&gt; — including bots and scrapers that scan AWS IP ranges every minute.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Cost:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data breaches&lt;/li&gt;
&lt;li&gt;Compliance failures (GDPR, HIPAA, etc.)&lt;/li&gt;
&lt;li&gt;Brand reputation loss&lt;/li&gt;
&lt;li&gt;AWS Security Hub alerts going wild&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Better Approach:
&lt;/h3&gt;

&lt;p&gt;Use &lt;strong&gt;pre-signed URLs&lt;/strong&gt; or &lt;strong&gt;bucket policies with fine-grained permissions&lt;/strong&gt;. Use &lt;code&gt;aws:Referer&lt;/code&gt; headers or &lt;strong&gt;Amazon CloudFront signed cookies&lt;/strong&gt; for access control.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Misuse #2: &lt;strong&gt;No Lifecycle Policies = Skyrocketing Storage Bills&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;S3 is “cheap” per GB, but it adds up. Especially if you’re uploading logs, backups, videos, or user-generated content.&lt;/p&gt;

&lt;p&gt;Without &lt;strong&gt;lifecycle policies&lt;/strong&gt;, your S3 bucket becomes a black hole of never-deleted data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Scenario:
&lt;/h3&gt;

&lt;p&gt;You store user session data (JSON files) for 100,000 users daily. Each file is 1MB.&lt;/p&gt;

&lt;p&gt;In one month:&lt;br&gt;
&lt;code&gt;100,000 * 30 * 1MB = 3TB&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At \$0.023/GB → \$69/month.&lt;br&gt;
In a year → Over \$800 for data you might not even need.&lt;/p&gt;
&lt;h3&gt;
  
  
  Better Approach:
&lt;/h3&gt;

&lt;p&gt;Use &lt;strong&gt;S3 Lifecycle Rules&lt;/strong&gt; to automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transition older objects to &lt;strong&gt;S3 Glacier&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Delete objects after a defined period&lt;/li&gt;
&lt;li&gt;Move data based on access frequency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s a sample lifecycle rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Rules"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;   &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"ID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"MoveOldLogs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Filter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"logs/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Enabled"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Transitions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;       &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;         &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Days"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;         &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"StorageClass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"GLACIER"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;       &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Expiration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Days"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;   &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Misuse #3: &lt;strong&gt;Uploading Files Without Using Multipart Upload&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Uploading large files (100MB+) directly using single &lt;code&gt;PUT&lt;/code&gt; requests is inefficient and error-prone.&lt;/p&gt;

&lt;p&gt;It’s common for developers to run into “Connection reset” or timeout errors when uploading large media or backups.&lt;/p&gt;

&lt;h3&gt;
  
  
  The AWS Way:
&lt;/h3&gt;

&lt;p&gt;Use &lt;strong&gt;Multipart Upload&lt;/strong&gt;, especially for anything over 100MB. It splits your file into parts and uploads them in parallel, improving resilience and speed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws s3 &lt;span class="nb"&gt;cp &lt;/span&gt;bigfile.zip s3://mybucket/ &lt;span class="nt"&gt;--expected-size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1000000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or better, use AWS SDKs with automatic multipart support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why It Matters:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Efficient bandwidth usage&lt;/li&gt;
&lt;li&gt;Retries only failed parts&lt;/li&gt;
&lt;li&gt;Parallel uploads = faster throughput&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Misuse #4: &lt;strong&gt;Assuming AWS Manages Your Data Security&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;A lot of devs assume, “It’s on AWS. It must be secure.”&lt;/p&gt;

&lt;p&gt;Wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS follows the Shared Responsibility Model&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They secure the infrastructure.&lt;/li&gt;
&lt;li&gt;You secure your data and access.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Common Mistakes:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No encryption at rest (&lt;code&gt;SSE-S3&lt;/code&gt; or &lt;code&gt;SSE-KMS&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;No encryption in transit (&lt;code&gt;HTTPS&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;IAM users with full &lt;code&gt;s3:*&lt;/code&gt; access&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Best Practices:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;KMS encryption&lt;/strong&gt; with key rotation&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;bucket versioning&lt;/strong&gt; to track changes or deletes&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;fine-grained IAM roles&lt;/strong&gt; instead of wide open permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Misuse #5: &lt;strong&gt;Serving Static Sites Without CloudFront&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Using S3 static website hosting &lt;strong&gt;without CloudFront&lt;/strong&gt; is a recipe for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High latency in non-US regions&lt;/li&gt;
&lt;li&gt;No caching&lt;/li&gt;
&lt;li&gt;No DDoS protection&lt;/li&gt;
&lt;li&gt;Lack of SSL (on custom domains)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;S3’s website hosting is good for PoC — &lt;strong&gt;not production.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Proper Setup:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Upload static assets to S3&lt;/li&gt;
&lt;li&gt;Serve through &lt;strong&gt;CloudFront&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;WAF&lt;/strong&gt; for security&lt;/li&gt;
&lt;li&gt;Use a &lt;strong&gt;custom domain with HTTPS&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User ↔ CloudFront ↔ S3 (private) + Route 53 (domain) + ACM (SSL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Misuse #6: &lt;strong&gt;Using S3 Like a Database&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Storing structured data (like JSON) in S3 and scanning it manually is a common trap.&lt;/p&gt;

&lt;p&gt;Yes, &lt;strong&gt;S3 is “infinite”&lt;/strong&gt;, but it’s not a database.&lt;/p&gt;

&lt;p&gt;Searching, updating, or querying structured data directly from S3 is slow and expensive.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix:
&lt;/h3&gt;

&lt;p&gt;Use &lt;strong&gt;Amazon Athena&lt;/strong&gt; or &lt;strong&gt;S3 Select&lt;/strong&gt; if you must query S3 files. Or better: store structured data in DynamoDB or RDS and use S3 only for blobs/assets.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Misuse #7: &lt;strong&gt;No Monitoring or Alerting&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;Many teams treat S3 as a “set and forget” system — until something breaks.&lt;/p&gt;

&lt;p&gt;No access logs. No monitoring. No alerts.&lt;/p&gt;

&lt;p&gt;Then a 100GB file gets uploaded, or a script runs wild and deletes a critical folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  What You Should Do:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Enable &lt;strong&gt;Server Access Logs&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;AWS CloudTrail&lt;/strong&gt; to monitor actions&lt;/li&gt;
&lt;li&gt;Set up &lt;strong&gt;Amazon CloudWatch Metrics + Alarms&lt;/strong&gt; for:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;  * Number of requests&lt;br&gt;
  * Data transfer cost&lt;br&gt;
  * Error rates&lt;/p&gt;
&lt;h2&gt;
  
  
  8. Misuse #8: &lt;strong&gt;Storing Too Many Objects in a Flat Namespace&lt;/strong&gt;
&lt;/h2&gt;
&lt;h3&gt;
  
  
  The Problem:
&lt;/h3&gt;

&lt;p&gt;S3 scales well, but if you dump 50 million files into a single bucket &lt;strong&gt;without prefixing&lt;/strong&gt;, performance takes a hit.&lt;/p&gt;

&lt;p&gt;AWS recommends using &lt;strong&gt;key prefixes&lt;/strong&gt; to distribute load.&lt;/p&gt;
&lt;h3&gt;
  
  
  Good Practice:
&lt;/h3&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/uploads/file1.jpg
/uploads/file2.jpg
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/uploads/2024/01/file1.jpg
/uploads/2024/01/file2.jpg
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use UUID-based hashing for large-scale uploads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/uploads/f1/a2/file1.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-World Horror Story: The Startup That Got Burned
&lt;/h2&gt;

&lt;p&gt;A growing SaaS platform stored all customer data (JSON and PDFs) in a public S3 bucket “for speed.”&lt;/p&gt;

&lt;p&gt;They didn’t enforce HTTPS, didn’t encrypt the files, and forgot to restrict access.&lt;/p&gt;

&lt;p&gt;Within months, a researcher found the exposed bucket and leaked it on Twitter. It contained contracts and private data for over 10,000 users.&lt;/p&gt;

&lt;p&gt;The startup spent \$40,000+ on damage control, faced legal risk, and lost customers due to broken trust — all for a “simple bucket.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro Tips to Master S3 Like a Pro
&lt;/h2&gt;

&lt;p&gt;Let’s flip the script. Here’s how to actually &lt;strong&gt;use S3 like a seasoned dev&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tip                   &lt;/th&gt;
&lt;th&gt;Description                                                     &lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Secure by default  &lt;/td&gt;
&lt;td&gt;Block public access, encrypt everything, use IAM roles not users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use object tagging&lt;/td&gt;
&lt;td&gt;Helps in auditing, tracking, or cost allocation                 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enable versioning  &lt;/td&gt;
&lt;td&gt;Prevents accidental deletes, supports recovery                  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Analyze usage      &lt;/td&gt;
&lt;td&gt;Use AWS Cost Explorer + S3 Storage Lens                         &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Global distribution&lt;/td&gt;
&lt;td&gt;Use CloudFront for latency reduction and caching                &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expiration policies&lt;/td&gt;
&lt;td&gt;Always define lifecycle rules for cleanup                       &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Final Checklist: Are You Using S3 the Right Way?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Is your bucket public?&lt;/li&gt;
&lt;li&gt;[ ] Are you using lifecycle rules?&lt;/li&gt;
&lt;li&gt;[ ] Do you encrypt data at rest and in transit?&lt;/li&gt;
&lt;li&gt;[ ] Are you using CloudFront in front of static content?&lt;/li&gt;
&lt;li&gt;[ ] Do you use IAM roles with least privileges?&lt;/li&gt;
&lt;li&gt;[ ] Do you monitor S3 metrics and logs?&lt;/li&gt;
&lt;li&gt;[ ] Are you using multipart upload for large files?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you checked &lt;strong&gt;any&lt;/strong&gt; of the wrong boxes — you’re in the 85%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up: Treat S3 Like the Power Tool It Is
&lt;/h2&gt;

&lt;p&gt;Amazon S3 isn’t just a dumb file store. It’s a critical part of modern application architecture.&lt;/p&gt;

&lt;p&gt;When misused, it creates performance bottlenecks, compliance issues, and unexpected costs.&lt;/p&gt;

&lt;p&gt;When used right — it's a low-latency, secure, infinitely scalable asset that can power everything from mobile apps to data lakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You may also like:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Large Companies Using Node.js for Backend&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/why-85-of-developers-use-express-js-wrongly-8c9c6f380fce" rel="noopener noreferrer"&gt;&lt;strong&gt;Why 85% of Developers Use Express.js Wrongly&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-node-js-middleware-for-efficient-coding-5ab0b0e82ea0" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Node.js Middleware for Efficient Coding&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-key-differences-worker-threads-vs-child-processes-in-node-js-5259a35a687a" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Key Differences: Worker Threads vs Child Processes in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-effective-caching-strategies-for-node-js-applications-bb9ac30c69d0" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Effective Caching Strategies for Node.js Applications&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-mongoose-performance-mistakes-that-slow-your-app-e204577b90f5" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Mongoose Performance Mistakes That Slow Your App&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/building-your-own-mini-load-balancer-in-node-js-yes-you-can-09157bb3ff4f" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Your Own Mini Load Balancer in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-tips-for-serverless-nodejs-api-deployment-448n"&gt;&lt;strong&gt;7 Tips for Serverless Node.js API Deployment&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-host-a-mongoose-powered-app-on-flyio-4fpk"&gt;&lt;strong&gt;How to Host a Mongoose-Powered App on Fly.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/the-real-reason-node-js-is-so-fast-its-all-about-concurrency-b3d71b432c1f" rel="noopener noreferrer"&gt;&lt;strong&gt;The Real Reason Node.js Is So Fast&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-must-know-node-js-patterns-for-application-growth-a1b5fac9d047" rel="noopener noreferrer"&gt;&lt;strong&gt;10 Must-Know Node.js Patterns for Application Growth&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-deploy-a-dockerized-nodejs-app-on-google-cloud-run-4i0i"&gt;&lt;strong&gt;How to Deploy a Dockerized Node.js App on Google Cloud Run&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arunangshudas.com/blog/can-node-js-handle-millions-of-users/" rel="noopener noreferrer"&gt;&lt;strong&gt;Can Node.js Handle Millions of Users?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-mistakes-every-beginner-node-js-developer-makes-fccff256c0e5" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Deploy a Node.js App on Vercel&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;&lt;strong&gt;6 Common Misconceptions About Node.js Event Loop&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-common-garbage-collection-issues-in-nodejs-jm1"&gt;&lt;strong&gt;7 Common Garbage Collection Issues in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-do-i-fix-performance-bottlenecks-in-nodejs-5e76"&gt;&lt;strong&gt;How Do I Fix Performance Bottlenecks in Node.js?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/what-are-the-advantages-of-serverless-nodejs-solutions-4p7d"&gt;&lt;strong&gt;What Are the Advantages of Serverless Node.js Solutions?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/high-traffic-node-js-strategies-for-success-ab4908c8dfc0" rel="noopener noreferrer"&gt;&lt;strong&gt;High-Traffic Node.js: Strategies for Success&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Read more blogs from&lt;/strong&gt; &lt;a href="https://blog.arunangshudas.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can easily reach me with a&lt;/strong&gt; &lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;&lt;strong&gt;quick call right from here.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let's discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me on&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
      <category>s3</category>
    </item>
    <item>
      <title>10 VSCode Settings Devs Never Optimize</title>
      <dc:creator>Arunangshu Das</dc:creator>
      <pubDate>Mon, 16 Jun 2025 03:31:00 +0000</pubDate>
      <link>https://forem.com/arunangshu_das/10-vscode-settings-devs-never-optimize-3i05</link>
      <guid>https://forem.com/arunangshu_das/10-vscode-settings-devs-never-optimize-3i05</guid>
      <description>&lt;p&gt;Visual Studio Code (VSCode) is more than just a text editor—it’s practically a dev companion. But here’s the kicker: most developers barely scratch the surface of what it offers. They install a few extensions, maybe choose a dark theme, and move on. Yet, buried within its settings are powerful tweaks that can drastically improve productivity, reduce errors, and even boost code quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Files: Auto Save (Make Your Sanity Permanent)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Auto-save is off.&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You forget to save, your computer crashes, and your last changes are gone. Classic.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;

&lt;p&gt;Go to Settings &amp;gt; Search for &lt;strong&gt;Auto Save&lt;/strong&gt;&lt;br&gt;
Or add this to your &lt;code&gt;settings.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"files.autoSave"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"onWindowChange"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are several options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;"off"&lt;/code&gt; – default&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"afterDelay"&lt;/code&gt; – saves after X milliseconds&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"onWindowChange"&lt;/code&gt; – saves when you switch windows&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"onFocusChange"&lt;/code&gt; – saves when focus leaves the editor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Saving automatically eliminates so many “oops” moments. It’s especially helpful during testing, when you switch between terminal and editor rapidly.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;2. Editor: Format on Save (The Code Police You Actually Need)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Off&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Messy code piles up, and you tell yourself “I’ll fix it later.” (Spoiler: You won’t.)&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"editor.formatOnSave"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Also, ensure you have a formatter like Prettier or ESLint installed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Whether you’re writing JavaScript, Python, or even HTML/CSS, consistent formatting keeps your code clean, readable, and merge-friendly.&lt;/p&gt;

&lt;p&gt;No more 40-line PRs with changes that are just formatting.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;3. Editor: Tab Size and Detect Indentation (Silently Breaks Teams)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Often 4 spaces or mixed&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; One dev uses tabs, another uses 2 spaces, and suddenly your git diff looks like a war zone.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"editor.tabSize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"editor.insertSpaces"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"editor.detectIndentation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Set a consistent style, and VSCode will stop guessing what indentation should be. Less visual clutter, fewer merge conflicts, more harmony.&lt;/p&gt;

&lt;p&gt;Pro tip: Add a &lt;code&gt;.editorconfig&lt;/code&gt; file to enforce this across your team.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;4. Files: Exclude / Search: Exclude (Your CPU Will Thank You)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Includes all files in searches and intellisense&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You’re searching “config” and VSCode returns 400 results from &lt;code&gt;node_modules/&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"files.exclude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"**/node_modules"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"**/dist"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"**/.git"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"search.exclude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"**/node_modules"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"**/dist"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
This keeps your workspace cleaner, searches faster, and indexing less CPU-intensive.&lt;/p&gt;

&lt;p&gt;It's like decluttering your brain… but for your editor.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;5. Git: Enable Smart Commit (Avoid WIP Purgatory)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Requires staging changes manually&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You type &lt;code&gt;Ctrl+Enter&lt;/code&gt; expecting it to commit… but nothing happens. You’re forced to stage files like it’s 2009.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"git.enableSmartCommit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
This allows you to commit directly from the Source Control panel without staging files manually. It’s great for fast-paced commits when you’re sure of your changes.&lt;/p&gt;

&lt;p&gt;Pair it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"git.confirmSync"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make push/pull even smoother.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;6. Terminal: Integrated Shell (Stop Fighting with Your CLI)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; VSCode uses the system default shell&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You prefer &lt;code&gt;zsh&lt;/code&gt;, &lt;code&gt;fish&lt;/code&gt;, or even PowerShell—but VSCode keeps opening the default shell.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do (Mac example):
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"terminal.integrated.defaultProfile.osx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"zsh"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For Windows or Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"terminal.integrated.defaultProfile.windows"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PowerShell"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"terminal.integrated.defaultProfile.linux"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bash"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Make VSCode match your terminal habits. Less context switching. Better shell history. More productivity.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;7. Code Folding &amp;amp; Bracket Pairs (Visual Peace of Mind)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; On, but basic&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Nested functions, deeply scoped logic, and multi-file classes turn your editor into spaghetti.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"editor.folding"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"editor.foldingStrategy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"auto"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"editor.matchBrackets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"always"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Also consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"editor.guides.bracketPairs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"active"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Easier navigation. Instant clarity on what function you're in. Collapsing large chunks of code lets you focus on just what you’re working on.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;8. Breadcrumbs and Outline View (Find Anything, Instantly)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; On, but underused&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You’re scrolling endlessly to find that function in a 1000-line file.&lt;/p&gt;
&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;

&lt;p&gt;Enable breadcrumbs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"breadcrumbs.enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And start using the Outline view (Command Palette → “Toggle Outline”).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Breadcrumbs show your current scope (e.g. &lt;code&gt;index.js &amp;gt; function &amp;gt; block&lt;/code&gt;)&lt;br&gt;
Outline gives you a sidebar overview of all functions, classes, and variables in the file.&lt;/p&gt;

&lt;p&gt;Massive files become manageable again.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;9. Workbench: Editor Limit &amp;amp; Restore View State (Declutter Like a Pro)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Keeps every file you ever opened open&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You have 42 tabs open, don’t know what’s what, and performance is tanking.&lt;/p&gt;

&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"workbench.editor.limit.enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"workbench.editor.limit.perEditorGroup"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"workbench.editor.limit.value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"workbench.editor.restoreViewState"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
VSCode will limit the number of open files, auto-close older ones, and &lt;em&gt;remember&lt;/em&gt; scroll positions and cursor placements when you return. It’s like memory foam… for your files.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;10. Extensions Auto Update and Settings Sync (Your Future Self Will Thank You)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Default behavior:&lt;/strong&gt; Extensions update manually&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; You use VSCode on multiple machines (home, work, laptop), but nothing is synced.&lt;/p&gt;

&lt;h3&gt;
  
  
  What to do:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"extensions.autoUpdate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"sync.enable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Log into your GitHub or Microsoft account to enable Settings Sync.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why you should care:&lt;/strong&gt;&lt;br&gt;
Imagine setting up your VSCode &lt;em&gt;once&lt;/em&gt;, and never needing to do it again—even on a fresh install.&lt;/p&gt;

&lt;p&gt;Everything—extensions, themes, keyboard shortcuts, and settings—will sync across machines. You’ll never feel “out of place” again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Top Extensions That Work Better with These Settings
&lt;/h2&gt;

&lt;p&gt;Now that your settings are optimized, pair them with the right tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prettier&lt;/strong&gt; – Code formatter&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ESLint&lt;/strong&gt; – JS/TS linting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bracket Pair Colorizer 2&lt;/strong&gt; – Enhanced readability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitLens&lt;/strong&gt; – Better Git insights&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Path Intellisense&lt;/strong&gt; – Autocomplete file paths&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TabNine or Copilot&lt;/strong&gt; – AI code suggestions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TODO Highlight&lt;/strong&gt; – Highlights comments like &lt;code&gt;// TODO:&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These extensions + the optimized settings above = productivity explosion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Most developers spend &lt;em&gt;thousands&lt;/em&gt; of hours inside their editors. Yet very few spend even 10 minutes customizing the environment that powers all of their work. That’s like a racecar driver refusing to adjust the seat.&lt;/p&gt;

&lt;p&gt;Don’t be that dev.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You may also like:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-large-companies-using-node-js-for-backend-f32aa3e55cdd" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Large Companies Using Node.js for Backend&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/why-85-of-developers-use-express-js-wrongly-8c9c6f380fce" rel="noopener noreferrer"&gt;&lt;strong&gt;Why 85% of Developers Use Express.js Wrongly&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/top-10-node-js-middleware-for-efficient-coding-5ab0b0e82ea0" rel="noopener noreferrer"&gt;&lt;strong&gt;Top 10 Node.js Middleware for Efficient Coding&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-key-differences-worker-threads-vs-child-processes-in-node-js-5259a35a687a" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Key Differences: Worker Threads vs Child Processes in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-effective-caching-strategies-for-node-js-applications-bb9ac30c69d0" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Effective Caching Strategies for Node.js Applications&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/5-mongoose-performance-mistakes-that-slow-your-app-e204577b90f5" rel="noopener noreferrer"&gt;&lt;strong&gt;5 Mongoose Performance Mistakes That Slow Your App&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/building-your-own-mini-load-balancer-in-node-js-yes-you-can-09157bb3ff4f" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Your Own Mini Load Balancer in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-tips-for-serverless-nodejs-api-deployment-448n"&gt;&lt;strong&gt;7 Tips for Serverless Node.js API Deployment&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-host-a-mongoose-powered-app-on-flyio-4fpk"&gt;&lt;strong&gt;How to Host a Mongoose-Powered App on Fly.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/the-real-reason-node-js-is-so-fast-its-all-about-concurrency-b3d71b432c1f" rel="noopener noreferrer"&gt;&lt;strong&gt;The Real Reason Node.js Is So Fast&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-must-know-node-js-patterns-for-application-growth-a1b5fac9d047" rel="noopener noreferrer"&gt;&lt;strong&gt;10 Must-Know Node.js Patterns for Application Growth&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-to-deploy-a-dockerized-nodejs-app-on-google-cloud-run-4i0i"&gt;&lt;strong&gt;How to Deploy a Dockerized Node.js App on Google Cloud Run&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arunangshudas.com/blog/can-node-js-handle-millions-of-users/" rel="noopener noreferrer"&gt;&lt;strong&gt;Can Node.js Handle Millions of Users?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/10-mistakes-every-beginner-node-js-developer-makes-fccff256c0e5" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Deploy a Node.js App on Vercel&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/6-common-misconceptions-about-nodejs-event-loop-3kio"&gt;&lt;strong&gt;6 Common Misconceptions About Node.js Event Loop&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/7-common-garbage-collection-issues-in-nodejs-jm1"&gt;&lt;strong&gt;7 Common Garbage Collection Issues in Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/how-do-i-fix-performance-bottlenecks-in-nodejs-5e76"&gt;&lt;strong&gt;How Do I Fix Performance Bottlenecks in Node.js?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/arunangshu_das/what-are-the-advantages-of-serverless-nodejs-solutions-4p7d"&gt;&lt;strong&gt;What Are the Advantages of Serverless Node.js Solutions?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://article.arunangshudas.com/high-traffic-node-js-strategies-for-success-ab4908c8dfc0" rel="noopener noreferrer"&gt;&lt;strong&gt;High-Traffic Node.js: Strategies for Success&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Read more blogs from&lt;/strong&gt; &lt;a href="https://blog.arunangshudas.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can easily reach me with a&lt;/strong&gt; &lt;a href="https://topmate.io/arunangshudas" rel="noopener noreferrer"&gt;&lt;strong&gt;quick call right from here.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share your experiences in the comments, and let's discuss how to tackle them!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me on&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/arunangshu-das/" rel="noopener noreferrer"&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>developer</category>
      <category>discuss</category>
      <category>explainlikeimfive</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
