I built an aurora forecast site on Cloudflare Workers and hit every limit they have
Every aurora app answers the wrong question. They show you Kp indexes, solar wind speed, magnetometer plots — great if you're a space-weather nerd. But a traveler standing in Tromsø asks something simpler: "will I actually see it tonight?" The honest answer depends as much on clouds, darkness, and the moon as it does on the sun. A Kp 7 storm is worthless under overcast skies. A quiet Kp 2 night…
Aurora Visible is a site that predicts whether travelers can see the Northern Lights at a specific location on a given night. It uses four factors to decide the visibility: darkness, geomagnetic activity, clear skies, and moonlight. The site covers eight popular destinations, offers a daily verdict updated every 30 minutes, provides monthly odds based on 30 years of data, and allows for trip planning.
The creator built it using Cloudflare Workers, but quickly ran into several limits of the platform. The first issue was related to dynamic API calls within a layout segment, which caused all pages in that segment to become fully dynamic, using up the free tier's subrequest limit. The fix was to make the 404 page a client component that derives the locale from the URL path.
The second problem was the 10ms CPU ceiling for each request, which Next.js SSR pages exceeded, causing intermittent 503 errors. The solution was to upgrade to the paid plan, which increases the CPU limit to 30 seconds. The third issue was subrequest arithmetic, where fetching Open-Meteo data for all destinations at once resulted in 8 subrequests.
Refactoring the code to make a single request with comma-separated coordinates reduced the number of subrequests to 12. Overall, the author found Workers to be a good fit for this site, especially considering the lower cost compared to alternatives like Vercel.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.