EdgeOne Pages Next.js Starter - SSR
Each request is rendered in real-time on the server, ensuring content is always up-to-date.
Ideal for dynamic and personalized content demanding strong SEO and immediate data freshness. This ensures optimal search engine visibility and up-to-the-minute information display for applications such as interactive user portals or live data analytics platforms.
// app/ssr/page.tsx
// Force dynamic rendering - disable static optimization
export const dynamic = 'force-dynamic'
export default async function SSRPage() {
// This function runs on the server for EVERY request
const data = await fetch('https://api.example.com/real-time-data', {
cache: 'no-store' // Disable cache - ensures fresh data every time
})
const jsonData = await data.json()
return (
<div>
<h2>SSR: Server-Side Rendering</h2>
<p>This page is rendered on the server for every request.</p>
<p>Request Time: {new Date().toISOString()}</p>
<p>Server Time: {new Date().toISOString()}</p>
<p>Real-time Data: {jsonData.value}</p>
</div>
)
}🔄 This page uses the SSR strategy!
SSR: Server-Side Rendering
This page is re-rendered every time a request is made, and data such as timestamps are updated in real-time.
Request Time:2025-10-25T14:50:35.353Z
Server Time:2025-10-25T14:50:35.353Z
Data Fetch Time:2025-10-25T14:50:35.353Z
Real-time Value:771
Timestamp:1761403835353
Server Hash:hatkd5
SSR: Server-Side Rendering Feature Explanation
• Real-time Rendering: Each request is rendered on the server in real-time
• Dynamic Content: Content is always up-to-date and personalized
• Server Processing: Requires server processing for each request
• SEO Friendly: Search engines can crawl the fully rendered content