0
0
Flaskframework~5 mins

Server-Sent Events alternative in Flask - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a common alternative to Server-Sent Events (SSE) for real-time communication in Flask?
WebSockets are a common alternative to SSE. They allow two-way communication between client and server, unlike SSE which is one-way from server to client.
Click to reveal answer
intermediate
How does WebSocket communication differ from Server-Sent Events?
WebSockets provide full-duplex communication, meaning both client and server can send messages independently. SSE only allows the server to push updates to the client.
Click to reveal answer
beginner
Which Flask extension helps implement WebSockets easily?
Flask-SocketIO is a popular extension that simplifies adding WebSocket support to Flask applications.
Click to reveal answer
intermediate
What is a key benefit of using WebSockets over SSE in a chat application?
WebSockets allow instant two-way messaging, so users can send and receive messages in real time without refreshing or waiting for server pushes.
Click to reveal answer
intermediate
Can WebSockets work over the same HTTP ports as SSE?
Yes, WebSockets start with an HTTP handshake on the same ports (usually 80 or 443) and then upgrade the connection to a persistent socket.
Click to reveal answer
Which of these is a two-way communication protocol suitable as an SSE alternative?
ALong Polling
BHTTP Polling
CWebSockets
DAJAX
Which Flask extension is commonly used to add WebSocket support?
AFlask-SocketIO
BFlask-RESTful
CFlask-WTF
DFlask-Migrate
What is a limitation of Server-Sent Events compared to WebSockets?
AOnly server can send messages
BOnly supports text data
CRequires HTTPS
DDoes not work in modern browsers
How do WebSockets start their connection?
ADirect TCP connection
BHTTP handshake then upgrade
CUDP broadcast
DFTP session
Which scenario benefits most from WebSockets over SSE?
ALive news feed
BSimple notifications
CStatic website
DInteractive chat app
Explain why WebSockets are often preferred over Server-Sent Events for real-time apps in Flask.
Think about how messages flow between client and server.
You got /4 concepts.
    Describe how a WebSocket connection is established starting from an HTTP request.
    Consider the initial steps before the connection stays open.
    You got /4 concepts.