Scaling QR Code Generation to 500 Codes in 10 Seconds

· 4 min · qrcheetah.com

Generating one QR code is trivial. Generating 500 branded QR codes with unique tracking URLs, storing the images, and setting up redirect analytics for each one -- in a time frame that does not make the user stare at a spinner -- is a different problem entirely. Here is how QR Cheetah handles batch generation at scale.

The Batch Generation Challenge

Enterprise customers need QR codes in bulk. A restaurant chain needs a unique code for every location. A conference needs one for every attendee badge. A marketing team needs hundreds for a direct mail campaign. Each code has to encode a unique tracking URL, apply consistent branding (colors, logo, error correction level), and produce a downloadable image file.

Processing these sequentially would take minutes. Instead, QR Cheetah breaks batch requests into parallel work units. Each unit generates a single QR code image, stores it, and creates the associated tracking record. The system processes multiple units simultaneously, bounded only by the available concurrency. For a 500-code batch, this means generation completes in roughly 10 seconds rather than the several minutes a sequential approach would take.

The Redirect and Tracking System

Every dynamic QR code in the system does not point directly to the destination URL. It points to a redirect endpoint that sits between the scanner and the destination. When someone scans a code, the redirect service receives the request, extracts analytics data -- device type, approximate location from the IP, browser, and timestamp -- stores it, and then immediately forwards the scanner to the actual destination with a temporary redirect response.

The redirect must be fast. Scanners expect near-instant navigation. The analytics recording happens asynchronously so it does not block the redirect. The scanner gets forwarded in under 50 milliseconds on average, and the analytics data gets written to the database in the background. A temporary redirect (302) is used instead of a permanent redirect (301) so that browsers do not cache the redirect and bypass the tracking endpoint on subsequent scans.

Keeping Scan Analytics Honest

Raw scan counts are unreliable. When someone shares a QR code link in a group chat, every messaging platform in the group fetches the URL to generate a link preview. A single share in a 50-person WhatsApp group can generate dozens of bot "scans" from preview crawlers. Without filtering, bot traffic accounts for 40% or more of apparent scans.

QR Cheetah maintains a list of known crawler signatures -- WhatsApp, Facebook, Twitter, LinkedIn, Slack, and others -- and excludes matching requests from scan counts. The bot requests are still logged for transparency, but they appear in a separate category so customers see accurate human scan numbers. This filtering is critical for customers who make business decisions based on scan data -- a direct mail campaign's ROI calculation is meaningless if half the reported scans are bots.

Image Delivery at Scale

Generated QR code images are stored once and served through a global CDN with long cache headers. Since QR code images do not change (the redirect destination can change, but the code image itself is static), aggressive caching works perfectly. A code generated in the US loads instantly when someone downloads it from Europe or Asia. The CDN handles the global distribution, and the origin storage only gets hit once per image.