Skip to content

Ask HN: How to design API for item with likes and how to cache it?

1 pointtyzerdakdiscuss
On HN

For example i have post:

I need to get attributes (id, title, body, likes) for not authenticated user. For authenticated user i also need to get is_liked (id, title, body, likes, is_liked). What I don't know is how to cache it and should i make 2 requests or single (and on php merge cached post with is_liked)?

What's is standard practice for things like this?

Comments

No comments yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.