Make sure your website or web application users get content updates right now with minimal latency. This concise guide shows you how to push new data from the server to clients with HTML5 Server-Sent Events (SSE), an exceptional technology that doesn’t require constant polling or user interaction. You’ll learn how to build a real-world SSE application from start to finish that solves a demanding domain problem.
Determine whether SSE, WebSockets, or data pull is best for your organization
Develop a working SSE application complete with backend and frontend solutions
Address error handling, system recovery, and other issues to make the application production-quality
Explore two fallback solutions for browsers that don’t support SSE
Tackle security issues, including authorization and "disallowed origin"
Develop realistic, repeatable data that’s useful in test-driven SSE design
Learn SSE protocol elements not covered in the example application
The animal on the cover of Data Push Apps with HTML5SSE is a short-beaked echidna (Tachyglossusaculeatus). The four species of echidnas, along with theplatypus, are the only mammals who lay eggs instead of giving birth to liveyoung. The short-beaked echidna is found in forested areas of Australia(where it is the most widespread native mammal) and parts of New Guinea.Short-beaked echidnas are 12–18 inches long, with brown fur andcream-colored spines (made of keratin) on their back. True to their name,their snouts are about 3 inches long, shorter than other echidna species.The leathery snout serves multiple purposes: its wedge shape is optimized toexplore insect mounds, it has electroreceptors that help detect nearby prey,and its labyrinth-like bone structure is believed to help condense exhaledwater vapor and cool the animal down (since echidnas do not have sweatglands). Echidnas are sometimes called spiny anteaters, though this term hasfallen out of use since they are not actually related to true anteaters.Their diet is indeed made up of insects, however—mostly ants and termites,which they catch by digging into the insects’ nests and capturing prey withtheir long sticky tongues. Echidnas are expert diggers, thanks to theirspecialized claws and strong short limbs. Apart from hunting prey, they alsodig as a defense mechanism; if threatened, they will burrow very quicklyinto the ground and roll into a ball, leaving only their sharp spinesexposed. They are also capable swimmers, which they do with only their noseabove water, like a snorkel.The short-beaked echidna appears on the reverse side of Australia’s5-cent coin, and has even made it into videogames, as the character Knucklesin the classic Sonic the Hedgehog series.The cover image is from Wood’s Animate Creation.