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.

HTTP Feeds: a minimal specification for polling events over HTTP

72 pointsby sea-gold21 days ago

8 comments

hombre_fatal20 days ago
It could use a section on high level justification &#x2F; inspiration.<p>For example, what inspired this over a typical paginated API that lets you sort old to new with an afterId parameter?
philsnow20 days ago
Because the client requests pagination by lastEventId (a UUID), the server needs to remember every event forever in order to correctly catch up clients.<p>If instead the client paginated by lastEventTimestamp, then a server that for any reason no longer had a particular event UUID could at least start at the following one.
评论 #43810237 未加载
sea-gold21 days ago
Previously discussed (April 2022; 95 comments): <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30904220">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30904220</a>
zzo38computer19 days ago
I think that HTTP is not the best way to do it, and that JSON is also not the best way to do it. (HTTP may work reasonably when you only want to download existing events and do not intend to continue polling.)<p>I also think using UUID alone isn&#x27;t the best way to make the ID number. If events only come from one source, then just using autoincrementing will work (like NNTP does for article numbers within a group); being able to request by time might also work (which is also something that NNTP does).
lud_lite20 days ago
What happens if you need to catch up? You keep calling in a loop with a new lastEventId?<p>What is the intention there though. Is this for social media type feeds, or is this meant for synchronising data (at the extreme for DB replication for example!).<p>What if anything is expected of the producer in terms of how long to store events?
评论 #43809137 未加载
DidYaWipe20 days ago
Never heard of &quot;CloudEvents&quot; before. How do people feel about those?
评论 #43810848 未加载
评论 #43809905 未加载
评论 #43809881 未加载
wackget20 days ago
Did someone just reinvent a GET API with cursor-based pagination?
评论 #43816872 未加载
fefe2320 days ago
This is an astonishingly bad idea. Don&#x27;t do this.<p>Use HTTP server-sent events instead. Those can keep the connection open so you don&#x27;t have to poll to get real-time updates and they will also let you resume from the last entry you saw previously.<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Server-sent_events&#x2F;Using_server-sent_events" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Server-sent...</a>
评论 #43808496 未加载
评论 #43808534 未加载
评论 #43810897 未加载