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 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?

share|improve this question
    
That's the way I'd do it. –  vancoder May 2 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 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 at 22:27

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.