StuntProgrammer

StuntProgrammer

Retry XMLHttpRequest Carefully

It’s rare to see a web app that doesn’t use XMLHttpRequest (or fetch, the new API with comparable capability). XMLHttpRequest (which we can call XHR if you’re into the whole brevity thing) is as handy as a shirt pocket, but it doesn’t do much to encourage robust and resilient programming practices. Any app that runs in the real world will sometimes encounter transient network interruptions and server outages. We should gracefully recover from both by automatically retrying our requests. But, we shouldn’t turn a brief server hiccup into a full-on fireworks display by retrying too fast or by having every client retry at the same time.

Where Next?

Popular Frontend topics Top

First poster: bot
Two ways you can take advantage of types in JavaScript (without TypeScript) - The Blinking Caret. This blog post describes how you can e...
New
New
First poster: bot
Stork Turns One: Building a search tool for static sites with Rust and WebAssembly • jameslittle.me. Stork, my web search side project, ...
New
First poster: bot
A WebAssembly Powered Augmented Reality Sudoku Solver. An Augmented Reality Sudoku solver using the WebAssembly build of OpenCV (a C++ ...
New
First poster: bot
In JavaScript programs, asynchrony arises in situations such as web-based user-interfaces, communicating with servers through HTTP reques...
/js
New
First poster: bot
Backend languages in the browser have been a thing for a long time. Google Web Toolkit would compile Java applications into JavaScript, a...
New
First poster: bot
Let’s build a fully functioning and settable “analog” clock with CSS custom properties and the calc() function. Then we’ll convert it int...
New
AstonJ
I love videos like this and it follows the same theme as @jaeyson’s thread here - I reckon the @ElixirCasts crew should consider experime...
New
First poster: bot
Since the Humio web client is built in Elm, I’d like to share some of our learnings with Elm over the years. Specifically, working with U...
New
First poster: davearonson
What is surprising is that a 14kB page can load much faster than a 15kBpage — maybe 612ms faster — while the difference between a 15kB an...
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
AstonJ
Or looking forward to? :nerd_face:
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
New