0

I am consuming an API that gives me a list of people and their profiles. My initial idea was working perfectly fine when it's just the list of people because I was just saving the ids and names using transients and then displaying them on a page. However, I now need to display each person's profile on a page so I reconstructed my idea.

My flow is now like this:

Hit API

Store in cache (transient)

Insert in post (custom post type) - my reason for inserting to the DB is because I need to have a format like /people/person_id. /people has the list of people /people/person_id has a person's profile.

The API consumer just runs once a day.

Is this a good process?

  • That's the way I'd do it. – vancoder May 2 '14 at 18:43
  • Hey @vancoder thanks for answering. I'm wondering if there's another way to display people/person_id without inserting to DB and just use transients all the way. – Pi Lover May 2 '14 at 18:59
  • 1
    if you need an index (/people) and a single (/people/person_id) that looks like a CPT to me. – vancoder May 2 '14 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.