5 ms·
I'm assuming 90% of these API requests are reads. Is there a reason Apollo couldn't develop an intermediate proxy server and cache all the responses for a short
by N_A_T_E 3y ago
I'm assuming 90% of these API requests are reads. Is there a reason Apollo couldn't develop an intermediate proxy server and cache all the responses for a short period of time? I assume that would cut the API usage significantly and potentially the cost.
- xii23 3y agoI didn't check, but I think their back-end already cached stuff somewhat; the dev open sourced it so you can take a look* * https://github.com/christianselig/apollo-backend https://github.com/christianselig/apollo-backend
- darknavi 3y agoHonestly sounds like a headache for outdated cache bugs. Reddit data is very fluid.
- Havoc 3y agoReddit API reads are all going to be pretty unique unfortunately. They're all logged in & have their own mix of subs selections etc
- shagie 3y agoThey are mostly reads. They are done every few seconds for each user to get the mailbox status for push notifications for monthly subscribers. https://youtu.be/Ypwgu1BpaO0?t=1772 https://youtu.be/Ypwgu1BpaO0?t=1772 > I guess there's an analogy um the way Reddit notifications work just for your inbox like you got a message or something um they work in so far as if I the developer of the app want to um say make sure that you get that notification within 10 seconds I have to be checking Reddit every 10 seconds to go like is there anything new is there anything new? is there anything new? is there anything new? okay. There is okay I'll tell is there anything new and then just repeating that at nauseam so you can imagine if you get a message once a week I'm checking every 10 seconds and then once during that whole week I get that message and then I can send it to you um so 99.99 of those API calls were wasted so we've talked to Reddit like that my friend who works on my server um and myself and I've said like what would be so much better is if we could just kind of keep like a port open with Reddit and say like you just tell us when there's a notification ready and we'll beam it off we don't have to bug you all the time and it's logical right and that's how a lot of services do it it's like an event-based API and um that's just not something reddit's ever uh given us Note that it does a request every 10 seconds for each user. At the API rate that would be about $0.25 every 3 hours (for each user) to support it.
- N_A_T_E 3y agoSeems like that refresh rate could be slowed down significantly. Heck, if its an existential issue for the app they could cut the mailbox status completely.