DEV Community

Discussion on: How would you go about providing minimal-latency web experience for a single local event?

Collapse
 
hiway profile image
Harshad Sharma • Edited

I do not know this for certain, though here's one way I imagine it could be done where a common WiFi is available:

  • Use service workers on browser.
  • Provision a capable caching/forwarding server on location, on same WiFi.
  • Add A records to 'local.example.com' for the server for every WiFi subnet being served.
  • Attempt to get user's local IP address (net.ipcalf.com/)
  • If DNS is advertising a server in that subnet, connect and verify certs.
  • Use the local server as long as it is reachable, revert to main site if it fails.

Curious now if this could actually work :D

Edit: Clarifying caching/forwarding server: it could simply be an instance of your webapp speaking with the main database via an isolated connection that uses local redis/tarantool/? for responding to floods of requests.