WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.