#SSR Island components update real time?
4 messages · Page 1 of 1 (latest)
Server island components in Astro do not update in real-time automatically. They are rendered on-demand when requested, but their content is not automatically updated after the initial render without some triggering event. Here's a more detailed explanation:
-
Initial Render: Server island components are rendered on the server when requested, and their HTML is sent to the client.
-
Client-side Behavior: After the initial render, the component's behavior depends on how it's implemented:
- By default, server island components remain static on the client side.
- They can be made interactive if you add client-side JavaScript to handle updates.
-
Updating Content: To update the content of a server island component, you typically need to trigger a new request or use client-side JavaScript to fetch and update the data.
According to the Astro documentation on server islands:
"When the page loads in the browser, these components will be requested to a special endpoint that renders them and returns the HTML. This means that users will see the most critical parts of the page instantly. Fallback content will be visible for a short amount of time before the dynamic islands are then loaded."
This indicates that server island components are loaded after the initial page load, but they don't automatically update in real-time without additional implementation.
If you need real-time updates, you would typically implement this using client-side JavaScript to fetch new data and update the component's content, or by using WebSockets for live data streaming.
Astro Documentation - Server Islands
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@sacred blaze Kapa.ai is still learning and improving, please let me know how I did by reacting below.