Print once, serve forever
The first time a learner opened a certificate, the platform filled in the template with their name, the course, the credits and the completion date, rendered it to a PDF and saved it under that learner’s folder. Every request after that skipped straight to the saved file. It was a cache, and like every cache, it was only as good as its rules for knowing when it was wrong.
It almost never knew. A client corrects the number of credits awarded or tweaks the certificate layout, and every certificate already printed stays exactly as it was. The learner downloads a certificate with the wrong credits, emails the client, the client emails us.