
Real-time & WebSockets
Mercure, WebSockets, Server-Sent Events, push notifications, real-time updates
1What is Symfony's recommended protocol for implementing real-time features?
What is Symfony's recommended protocol for implementing real-time features?
Відповідь
Mercure is Symfony's officially recommended protocol for real-time features. Developed by Kévin Dunglas (creator of API Platform), Mercure is based on Server-Sent Events (SSE) and offers native Symfony integration via the symfony/mercure bundle. It enables efficient server-to-client unidirectional communication with automatic reconnection.
2What is the main difference between WebSockets and Server-Sent Events (SSE)?
What is the main difference between WebSockets and Server-Sent Events (SSE)?
Відповідь
WebSockets establish a bidirectional full-duplex connection allowing both client and server to send messages at any time. SSE is unidirectional: only the server can send data to the client. SSE uses standard HTTP (easier to deploy behind proxies), while WebSockets use a distinct protocol after the initial handshake.
3Which Symfony bundle enables Mercure integration in an application?
Which Symfony bundle enables Mercure integration in an application?
Відповідь
The symfony/mercure-bundle provides official Mercure integration with Symfony. It automatically configures the HubInterface service for publishing updates and generates subscription URLs. The bundle is installed via Composer and requires an external Mercure hub (Caddy with Mercure module or standalone Mercure binary).
How to publish a message to a Mercure topic from a Symfony controller?
What is the purpose of JWT in Mercure authentication for private topics?
+15 питань зі співбесід
Інші теми співбесід Symfony
Modern PHP (8.1+)
Symfony Basics
Routing & Controllers
Twig & Templates
Doctrine ORM Basics
Symfony Forms
Data Validation
Dependency Injection & Services
Security & Authentication
Doctrine Advanced
API Platform
Serializer Component
Events & Event Subscribers
Console & Commands
Messenger Component
HTTP Client
Cache & Performance
Workflow Component
Testing Symfony
Mailer Component
Translations & i18n
EasyAdmin Bundle
Symfony Architecture
Performance & Optimization
Security Advanced
Custom Bundles
Microservices with Symfony
Deployment & DevOps
Опануй Symfony для наступної співбесіди
Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.
Почни безкоштовно