TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

1 pointsby tyzerdakover 5 years ago
For example i have post:<p>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&#x27;t know is how to cache it and should i make 2 requests or single (and on php merge cached post with is_liked)?<p>What&#x27;s is standard practice for things like this?

no comments

no comments