We're now websocket xd

This commit is contained in:
Ayase Minori 2023-10-23 01:05:39 +08:00 committed by GitHub
parent 4d1aded8a8
commit 4574557fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ finding a way to implement it, until I got bored, and then I picked it up again.
The new system I implemented works using the following:
- Using `BroadcastChannel`s - we can send SSEs to update the counter, and it only updates on mutation, so this is practically realtime.
- Using `BroadcastChannel`s and `WebSocket`s - we can send mutation events to update the counter, so this is practically realtime.
- No API is actually exposed to the user, so no one can just take the statistics endpoint and just spam it, because the statistics server is also the website.
- POSTing to the API is delayed by 5000ms (5s) before its submitted to the API in the frontend. While the provider does allow this, its due diligence to only submit it when there's inactivity.