All Posts

Google Was Failing to Crawl My Site — Because My SSL Didn’t Cover www
Adam C. |
For nearly three years, SwimStandards.com has quietly had a problem that I didn’t realize until recently: Googlebot was failing to crawl www.swimstandards.com due to an SSL error. I always assumed everything was working fine because: I only use https://swimstandards.com Google Search Console didn’t report any errors for the root domain
🔒 How I Back Up My Web App to Google Drive with rclone
Adam C. |
To protect against server failure, data loss, or accidental changes, I’ve automated daily backups of my web app — including both the MongoDB database and NodeBB forum files — and synced them securely to Google Drive using rclone.
Why Google AdSense Page Views Are Broken on SPAs (and What Actually Counts)
Adam C. |
If you're running a modern web app like Next.js, React, or Vue, you've probably noticed something strange in your AdSense dashboard: Page views are way lower than expected, but ad impressions seem fine. This isn’t a bug — it’s how AdSense works (or more accurately, how it doesn’t work with SPAs).
Is My 2-Core Server Enough? Real Traffic Test & Recommendations
Adam C. |
On May 28, I reviewed 20 minutes of live traffic logs from my website to evaluate whether my 2-core server could keep up with demand. The data showed over 13,000 requests — roughly 11 per second — with a mix of bot and real user traffic hitting SSR pages and API routes. While the server handled it, signs of strain appeared: spikes in TIME_WAIT, socket hang-up errors, and MongoDB lag. The conclusion? My setup is nearing its safe limits. Upgrading to 4 cores or offloading some processing (e.g., MongoDB or caching) may be necessary to maintain performance and stability as traffic grows.
Understanding PM2 Cluster Mode with Feathers.js and Next.js
Adam C. |
When deploying Node.js applications with PM2, it’s important to understand how cluster mode, instances, and CPU cores interact — especially when you’re combining multiple apps like a Next.js frontend and a Feathers.js backend. This post breaks down the core concepts and lessons learned from setting up next-dna and feathers-dna with PM2 cluster mode.
May Meltdown Fixes: Every Command I Ran to Battle Website Slowness
Adam C. |
In late May, my website faced severe performance issues—high server load, 'socket hang up' errors, and slow responses. Initially, I suspected new ad scripts, but removing them didn’t help. After days of debugging—adjusting Axios timeouts, blocking bots, optimizing the database, and disabling heavy features—I found the root cause. This post shares the steps I took
🐛 3 Years of Hidden Bug: How a Missing return Led to Slow Queries and Data Mismatch
Adam C. |
Just discovered a 3-year-old bug in my Feathers.js service: I was calling await setModel(...), but forgot to return a Promise inside setModel. The result? Queries sometimes hit the wrong MongoDB collection due to race conditions. It worked most of the time — until I checked the slow query logs. One missing return caused years of silent issues. Fixed now, and performance is back. Lesson learned.
Managing High TIME_WAIT and SYN_RECV in Production: Lessons from SwimStandards.com
Adam C. |
To reduce high SYN_RECV and TIME_WAIT states on our Next.js + Feathers.js server, we enabled HTTP keep-alive in Axios, monitored socket usage, and adjusted system settings (tcp_syncookies=1, somaxconn=1024). While keep-alive helped reduce overhead, increasing somaxconn didn’t clearly improve results and may need to be reverted. Final tuning may also depend on upstream traffic and reverse proxy behavior.
⚡️ MongoDB $exists vs null: Query Optimization Deep Dive
Adam C. |
Using { field: null } in MongoDB queries is often more efficient than { field: { $exists: false } }, because it allows the query to leverage indexes and avoid costly document fetches. We improved performance by switching from $exists: false to isWeak: null and updating the index to include isWeak, reducing query time from over 2 seconds to under 40ms. $exists is still safe in text search filters, but for most use cases, null is the better choice for speed and index optimization.
⚠️ “431 Request Header Fields Too Large” Error – What It Is and How to Fix It
Adam C. |
A quick explanation of the “431 Request Header Fields Too Large” error, what causes it (often oversized cookies), how users can fix it by clearing site data, and what we’re doing to prevent it in the future. This guide is especially useful if you encountered the issue on SwimStandards or any site using modern ad consent scripts.
MongoDB authSource Gotcha: Why Your User Works on the CLI but Fails in Code
Adam C. |
This post explains a common MongoDB authentication mistake: using the wrong authSource in your connection string. It shows why your CLI login may work while your app fails, how to properly set authSource, whether you need the /database path in the URI, and how to avoid hidden auth errors in PHP, Node.js, or any MongoDB client.
Why Your Nginx PHP Rewrites Might Fail — and How to Fix Them
Adam C. |
This post explains why Nginx PHP rewrites using regex-based location ~ blocks often fail — causing .php files to download instead of execute. It walks through a reliable no-regex solution using prefix-based locations and shows how to fix the regex approach by adding folder-specific .php handlers. Ideal for anyone implementing clean URLs in PHP with Nginx.
Why We Dropped mongodb/mongodb 1.x Support and Committed to ^2.0
Adam C. |
This post explains why we dropped support for mongodb/mongodb 1.x in favor of ^2.0, and the challenges of supporting multiple versions in an open-source PHP library. It highlights a key limitation of Composer: even if your composer.json allows multiple versions, composer.lock can only lock one. We walk through the trade-offs, the reasoning behind our decision, and best practices for maintaining compatibility across environments.
🐞 Cron Job Debug: SCP Failed Due to macOS Sleep Mid-Transfer
Adam C. |
A scheduled launchd job using scp failed to complete because macOS went to sleep mid-transfer, interrupting the connection. Adding caffeinate -s to the job prevented system sleep during execution, resolving the issue and ensuring all files transferred reliably.
Git Merge Strategies Explained: Fast-Forward, Merge Commit, and Squash
Adam C. |
When working with Git, merging branches is a fundamental part of collaboration. But not all merges are the same. There are three main merge strategies you can use, and each one impacts your repository history differently.
Understanding Git Merge Strategies: Merge, Rebase, Squash, and the Role of Staging Branches
Adam C. |
When working in a Git-based development team, especially in real-world projects, understanding how to manage branches and history is essential. This post explains the practical use of merge, rebase, and squash, as well as how to use demo or staging branches for safer and more flexible workflows.
Optimizing React Charts with Custom Hooks, useMemo, and Chart.js
Adam C. |
Working with interactive data visualizations in React is incredibly powerful, especially when using Chart.js via react-chartjs-2. But it can also be tricky—especially when performance and usability are key. In this post, we’ll break down how to build a performant and maintainable chart component with features like: Zooming and panning Data point navigation Tooltips and highlight syncing Let’s walk through how we solved performance issues, structured custom hooks, and handled state transitions cleanly.
 Understanding the ESLint Warning: useEffect and useCallback
Adam C. |
If you've ever seen this ESLint warning: React Hook useEffect has a missing dependency: 'yourFunction'. Either include it or remove the dependency array. You're not alone — and you're probably asking: Why is this happening? Why does it behave differently in a component vs. a custom hook? And do I really need to use useCallback() here? Let’s break this down clearly.
 Scheduling a Cron Job on macOS with Wake Support
Adam C. |
If you need to run a scheduled task on your Mac—even when it’s asleep—you’ll quickly find that cron doesn’t wake up the computer by itself. This post covers how to schedule a cron job at 7 AM on macOS and ensure it runs reliably, even if the Mac is sleeping.
Managing Apache Logs and Server Performance: A Real-World Case Study
Adam C. |
Server performance is critical for any web application, but it’s common to encounter issues caused by factors like excessive log growth, abusive IP traffic, or internal requests. In this blog post, we’ll walk through a real-world example of addressing these issues and optimizing server performance.