2
1 Comment

Sometimes the best optimization is not running your code at all

Two days ago I launched https://zenlesscodes.com - a simple code aggregator for Zenless Zone Zero on a $3/month VPS. Flask + Gunicorn, nothing fancy. But something was bugging me.
I kept looking at the architecture: Python handling thousands of requests per day... to serve data that only updates once per hour. Every single request triggered the full Python → Flask → Gunicorn stack, even though the response was identical for the next 60 minutes.

That's when it hit me: why am I running Python for every request when the data barely changes?
I ripped out Flask and Gunicorn completely. Now the Python code runs as a simple daemon that wakes up every hour, fetches new codes, and writes three static files. Nginx serves them directly.
No WSGI server. No request handlers. Just files on disk.

The results:

- 100x faster - Nginx static serving vs Python execution

- 5x less memory - dropped from ~100MB to ~20MB

- 10,000+ req/sec instead of ~100-500

- More resilient - if the daemon crashes, the site still serves content

The trade-off? Content can be up to 59 minutes old. But for a code aggregator, it's perfect.

The lesson: I think we overcomplicate things sometimes. I was running a full web framework to serve what's essentially a cron job output. The mental shift from "web app" to "file generator" unlocked massive gains.

If your data updates infrequently, ask yourself: do you really need a dynamic backend for every request? Or can you pre-generate everything and let your web server blast out static files at ridiculous speed?

For zenlesscodes, this felt like finding free money. Same $3 VPS, but now it handles 100x more traffic without breaking a sweat.

posted toAvatar for product ZenlessCodes
ZenlessCodes
  1. 1

    Congrats on the launch, looks solid. How are you currently thinking about acquiring early users and gathering feedback?