Push Notification by Push protocol
Push notifications are messages or alerts sent from a mobile app, website, or server to the user's device. They appear on the device's home screen or notification center, even when the app or website is not actively in use. Here's a detailed explanation of how push notifications work:
Initiation: Push notifications are initiated by app developers, website owners, or servers. They can be triggered by various events such as new messages, updates, reminders, or personalized notifications based on user activity.
Delivery: When a push notification is generated, it is sent to a push notification service (PNS) provided by the platform (such as Apple Push Notification Service for iOS devices, Firebase Cloud Messaging for Android devices, or web push services for browsers).
Registration: Before a device can receive push notifications, it needs to register with the appropriate PNS. This typically involves the app or website requesting permission from the user to send notifications and then registering a unique device token with the PNS.
Routing: The PNS receives the push notification and determines which devices should receive it based on the device tokens that have been registered for the app or website.
Delivery to Device: Once the PNS determines the target devices, it sends the push notification to those devices via a persistent connection (e.g., through APNs for iOS devices or FCM for Android devices).
Display: When the device receives the push notification, it displays the message to the user in the form of a notification alert. This alert typically includes a title, a message, and sometimes an image or additional actions.
Interaction: Users can interact with push notifications by tapping on them. Tapping a notification can open the corresponding app or website, take the user to a specific screen or content within the app or website, or trigger a custom action defined by the app developer or website owner.
Handling: Users can also dismiss or ignore push notifications, either individually or by clearing them all at once. Some platforms allow users to manage notification preferences, such as choosing which types of notifications they want to receive or adjusting notification settings.
Timing: Push notifications can be sent immediately or scheduled to be delivered at a specific time. They can also be triggered based on certain conditions or user behavior, such as location-based notifications or notifications triggered by in-app events.
Overall, push notifications are a powerful tool for app developers and website owners to engage with their users, provide timely information, and drive user engagement and retention. However, it's essential to use them responsibly and respect users' preferences to avoid overwhelming them with irrelevant or excessive notifications.
Detailed explanation of push notification by push protocol with real world example
Let's delve into a detailed explanation of push notifications using a push protocol like HTTP/2 Server Push.
Overview of HTTP/2 Server Push:
HTTP/2 Server Push is a feature of the HTTP/2 protocol that allows a server to proactively send resources to a client before the client requests them. This is particularly useful for pushing critical assets like CSS, JavaScript, or images to the client's browser, thereby improving page load times and user experience.
Detailed Explanation with Real-World Example:
Let's consider a hypothetical scenario of an e-commerce website:
User Visits the Website: A user opens their web browser and navigates to an e-commerce website to browse for products.
Initial Request: The user's browser sends an HTTP request to the website's server, requesting the HTML document for the homepage.
Server Processing: The server receives the request and starts processing it. While generating the HTML response, the server identifies critical assets required for rendering the webpage, such as CSS stylesheets, JavaScript files, and images.
Server Push: Instead of waiting for the browser to request these assets individually, the server proactively pushes them to the client using HTTP/2 Server Push. For example:
The server may push the main stylesheet and JavaScript file needed for the homepage.
It may also push images of popular products or promotional banners relevant to the user's browsing history or preferences.
Browser Reception: The user's browser receives the pushed resources along with the HTML response. It starts rendering the webpage immediately using these resources, without waiting for additional round-trip requests to the server.
Page Display: The user sees a fast-loading webpage with all the necessary resources already available, resulting in a smoother browsing experience.
User Interaction: As the user interacts with the website (e.g., clicking on product categories or adding items to the shopping cart), additional resources may be dynamically pushed to the browser based on the user's actions and preferences.
Efficient Resource Usage: HTTP/2 Server Push helps reduce latency and network round-trips by eliminating the need for the browser to make separate requests for critical resources. It optimizes resource delivery and enhances the perceived speed of the website.
Real-World Benefits:
Improved Performance: By pushing critical assets upfront, websites can significantly reduce page load times, leading to higher user satisfaction and engagement.
Optimized User Experience: Users experience a seamless browsing experience with fast-loading pages and smooth transitions between different sections of the website.
Bandwidth Efficiency: HTTP/2 Server Push minimizes the need for redundant requests, conserving bandwidth and reducing server load.
Enhanced SEO: Faster page load times can positively impact search engine rankings, as performance is a factor considered by search engine algorithms.
In summary, HTTP/2 Server Push is a powerful technique for optimizing web performance and delivering a superior user experience by proactively pushing critical resources to the client's browser.
Subscribe to my newsletter
Read articles from Rajdeep Singha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by