I’m building a store that allows users to order prints of photos. If the user orders a photo that has a different dimension than the one the photo is originally, they are prompted to crop the photo. The photo would only be held for a short time period, say twenty five minutes.
Is it appropriate to use the Transients API to hold the cropped photo data?
Transients would be a good option for sure assuming the data is crop instructions only. Transients work best performance-wise if you have memcached installed as well as an object cache plugin. As a caveat, don’t rely on object cache to be 100% solid. It is volatile and can be corrupted rather easily. I’ve found this to be quite true at times.
If you want a more fail-safe storage, you could just use transients without object cache as the key/value pairs will be stored as an expiring option in the options table.
Either way, transients are a convenient way to store temporary data. I would check out Mark Jaquith’s TLC Transient class. It’s a huge help getting transients setup in your theme.