Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.