SlideShare a Scribd company logo
Rethinking Server-Side
Rendering in Modern PHP
Applications
S I M O N E D ' A M I C O - P H P D A Y 2 0 2 5
Have you ever worked with SSR applications?
W H A T T H I S T A L K I S A L L A B O U T
Simone D'Amico
T E C H T E A M L E A D E R @
Full-time dad of two, Lego enthusiast, and
speaker. Author of Lead Through Mistakes,
a newsletter focused on leadership in the IT
world.
simonedamico.com
leadthroughmistakes.com
linkedin.com/in/simonedamico
W H A T I ' V E B U I L T U S I N G S S R
A Real Use Case
A Real Use Case
Revamping the listening platform to
improve listening and interaction
experience
M E D I A I N D U S T R Y
Hard to maintain, hard to evolve.
Legacy technologies and libraries
1 5 + Y / O P H P M O N O L I T H
Millions of search engine–indexed
pages
C O N T E N T O R I E N T E D
Team primarily skilled in PHP, little to
no experience in JavaScript
P H P - C E N T R I C T E A M
Solid APIs already available in the
CMS
R O B U S T E X I S T I N G A P I s
To test the product present it at a
major industry event
S H O R T T I M E T O M A R K E T
The Final Solution
BFF built to serve the
frontend consuming
existing APIs
Powered by CloudFront,
Lambda, and Bref delivering
everything at the edge, with
no traditional hosting
SSR allowed also to deliver
a fast, seamless user
experience similar
SSR to preserve SEO
performance and prevent
loss in search engine
visibility
B A C K E N D F O R
F R O N T E N D
S E R V E R - S I D E
R E N D E R I N G
S P A - L I K E
E X P E R I E N C E
S E R V E R L E S S
A R C H I T E C T U R E
A N I N T R O D U C T I O N
Server-Side Rendering
Server-Side Rendering
Source: https://prismic.io/blog/what-is-ssr
SSR vs CSR
JS is not a bad guy but this
doesn't necessarily mean it
has to be used for
everything.
SSR allows to use JS for
what it is made for: user
interactions
It can be integrated into
existing applications
incrementally, without
rewriting everything from
scratch
No multiple stacks and
codebases to maintain,
evolve and keep updated
Ensure a single source of
truth for State management
to avoid inconsistent data,
increased complexity,
overhead, unclear
separation of concerns
R E D U C E J S U S A G E
01
S T A T E C E N T R A L I Z E D
02
S I N G L E S T A C K
03
E A S Y I N T E G R A T I O N
04
Why SSR in PHP?
A set of tools and conventions that let you
progressively enhance server-rendered
templates using JavaScript, without adopting a
full SPA framework. It integrates closely with
Twig, Stimulus (for interactivity), and Turbo (for
navigation and updates)
A full-stack framework for Laravel that lets you
build interactive components using Blade and
PHP. It can be enhanced with Alpine.js for small
frontend behaviors, without requiring a full
JavaScript framework
What does the PHP ecosystem offer for SSR?
Is there a pattern we can follow?
Yep. It is very common in the Javascript world
and it is called: Component-Based Architecture
More info: https://ux.symfony.com/cookbook/component-architecture
Composition
Independence
Props
State
Composition
A page is no longer just a page but rather a collection of small,
reusable components
Composition
Independence
Props
State
Independence
The component lives in its own context. It should not be aware of the
rest of the page
Composition
Independence
Props
State
Props
The component must remain independent, but we can customize its
props. Props flow in one direction, from parent to child
Composition
Independence
Props
State
State
A state is pretty much like a prop, but the main difference is that a
state can change during the life of the component
L I V E W I R E A N D S Y M F O N Y U X I N A N U T S H E L L
Quickstart
A working example
github.com/dymissy/ssr-in-php
Installation
Create a template layout
It requires an HTML layout for components to
render inside
Components are rendered inside traditional
Twig blocks
Create a route
Livewire components can be registered as
routes
Components are rendered inside traditional
Symfony routes
Create a component
Components are PHP classes that inject properties to a template
Create a component
Components are PHP classes that inject properties to a template
Create an anonymous component
Components that don't require any custom logic beyond the properties injected
Cool, but… everything is static so far.
What about interactions?
1. State Change
Live components
Components that allows their own state to change during the component lifecycle
How does it work under the hood?
Live components
Components that allows their own state to change during the component lifecycle
How does it work under the hood?
Interaction with parent components
We can rely on events
Interaction with parent components
We can rely on events
2. SPA-like Navigation
SPA-like Navigation
Livewire will prevent the standard
handling of the link click and replace it
with its own, faster version
SPA-like Navigation
Thanks to Turbo library, Symfony watches
for link clicks and form submissions,
performs them in the background, and
updates the page without doing a full reload.
Forms
Livewire provides loads of helpful utilities for building them
Forms
Turbo Drive automatically converts form submissions to AJAX calls.
To get it to work, you do need to adjust your code to return a 422 status code on a validation error
The result
github.com/dymissy/ssr-in-php
Kind of hard to test with all this interaction,
isn’t it?
Testing
Source: https://livewire.laravel.com/docs/testing
Testing
Source: https://symfony.com/bundles/ux-live-component/current/index.html#test-helper
Still Not Enough? Craving More?
Want to take them to the next level?
Pre-built Live Components let you add
dynamic, reactive UI features without writing
JavaScript — just use PHP and Twig
Volt is a functional API for Livewire that
supports single-file components, allowing a
component's PHP logic and Blade templates to
coexist in the same file
Integrating with JS libraries
K E Y T A K E A W A Y S B E F O R E Y O U G O
Wrapping Up
•
•
•
•
We faced several challenges along the road:
performances
overweight states
shared sessions to allow coexistence with
legacy website during the migration
Octane memory leaks
I T W A S N ' T A L L S M O O T H
02
The context mattered.
Native Tailwind support and a Laravel-skilled
team made all the difference
W E O P T E D F O R L A R A V E L
01
Key Takeaways
SSR works best when when you need fast initial
load, great SEO, or simple user flows (eg.
content platforms).
SPA fits better when complex client-side
interactivity is the priority — like real-time
collaboration or design tools.
The key is not ideology, but context
S S R I S N ' T A O N E - S I Z E - F I T S - A L L S O L U T I O N
04
SSR in PHP is not just for new projects.
It works well even in existing apps. You can
start small, one component at a time, without
rewriting everything
N O T J U S T F O R G R E E N F I E L D P R O J E C T S
03
Key Takeaways
Thanks 🙏
linkedin.com/in/simonedamico
✉️
leadthroughmistakes.com
simone.damico86[at]gmail.com
Rate the talk!
Rethinking Server-Side Rendering in Modern PHP Applications

More Related Content

PDF
Things you must know on ruby on rails single page application
PDF
What Web Framework To Use?
PDF
Breaking free from monoliths: revolutionizing development with Livewire and S...
ODP
Evolutionary Design Solid
PDF
Introducing symfony
PDF
Web dev syllabus
PPTX
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
PDF
REST - What's It All About? (SAP TechEd 2012, CD110)
Things you must know on ruby on rails single page application
What Web Framework To Use?
Breaking free from monoliths: revolutionizing development with Livewire and S...
Evolutionary Design Solid
Introducing symfony
Web dev syllabus
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
REST - What's It All About? (SAP TechEd 2012, CD110)

Similar to Rethinking Server-Side Rendering in Modern PHP Applications (20)

PPTX
Domain Modeling & Full-Stack Web Development F#
PDF
Building Rich Applications with Appcelerator
PDF
Reasons Why Laravel is Better Over the PHP Frameworks
PDF
PHP is the King, nodejs is the Prince and Lua is the fool
PDF
Java Full Stack Developer Interview Questions PDF By ScholarHat
DOC
Krishnagopal Thogiti_Java
PPTX
Spring Framework Rohit
PDF
API Description Languages
PDF
API Description Languages
ODP
A Happy Cloud Friendly Java Developer with OpenShift
PPTX
Live Session1 lightning web component
PDF
Node.js Frameworks & Design Patterns Webinar
PDF
Frontend Development Bootcamp - React [Online & Offline] In Bangla
PDF
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
PDF
PHP is the king, nodejs is the prince and Lua is the fool
DOCX
COMP6210 Web Services And Design Methodologies.docx
PDF
Picking the Right Node.js Framework for Your Use Case
PDF
Simple Ways to Get Your Organization to Adopt the AsyncAPI Spec
PDF
Isomorphic apps
PDF
API Description Languages: Which Is The Right One For Me?
Domain Modeling & Full-Stack Web Development F#
Building Rich Applications with Appcelerator
Reasons Why Laravel is Better Over the PHP Frameworks
PHP is the King, nodejs is the Prince and Lua is the fool
Java Full Stack Developer Interview Questions PDF By ScholarHat
Krishnagopal Thogiti_Java
Spring Framework Rohit
API Description Languages
API Description Languages
A Happy Cloud Friendly Java Developer with OpenShift
Live Session1 lightning web component
Node.js Frameworks & Design Patterns Webinar
Frontend Development Bootcamp - React [Online & Offline] In Bangla
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
PHP is the king, nodejs is the prince and Lua is the fool
COMP6210 Web Services And Design Methodologies.docx
Picking the Right Node.js Framework for Your Use Case
Simple Ways to Get Your Organization to Adopt the AsyncAPI Spec
Isomorphic apps
API Description Languages: Which Is The Right One For Me?
Ad

More from Simone D'Amico (9)

PDF
Monitoring and Observability: Building Products That Don't Break in Silence
PDF
From code to leadership: Navigating the journey from Individual Contributor t...
PDF
Symfony UX: rivoluziona il tuo frontend con Symfony
PDF
Panther loves Symfony apps
PDF
Rory’s Story Cubes Retrospective
PDF
Symfony Cache Component: speed up your application with a new layer of cache
PDF
E-commerce con SF: dal case study alla realtà
PDF
Introduction to WordPress REST API
PPTX
Manage custom options pages in Wordpress
Monitoring and Observability: Building Products That Don't Break in Silence
From code to leadership: Navigating the journey from Individual Contributor t...
Symfony UX: rivoluziona il tuo frontend con Symfony
Panther loves Symfony apps
Rory’s Story Cubes Retrospective
Symfony Cache Component: speed up your application with a new layer of cache
E-commerce con SF: dal case study alla realtà
Introduction to WordPress REST API
Manage custom options pages in Wordpress
Ad

Recently uploaded (20)

PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MIND Revenue Release Quarter 2 2025 Press Release
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation

Rethinking Server-Side Rendering in Modern PHP Applications

  • 1. Rethinking Server-Side Rendering in Modern PHP Applications S I M O N E D ' A M I C O - P H P D A Y 2 0 2 5
  • 2. Have you ever worked with SSR applications? W H A T T H I S T A L K I S A L L A B O U T
  • 3. Simone D'Amico T E C H T E A M L E A D E R @ Full-time dad of two, Lego enthusiast, and speaker. Author of Lead Through Mistakes, a newsletter focused on leadership in the IT world. simonedamico.com leadthroughmistakes.com linkedin.com/in/simonedamico
  • 4. W H A T I ' V E B U I L T U S I N G S S R A Real Use Case
  • 5. A Real Use Case Revamping the listening platform to improve listening and interaction experience M E D I A I N D U S T R Y Hard to maintain, hard to evolve. Legacy technologies and libraries 1 5 + Y / O P H P M O N O L I T H Millions of search engine–indexed pages C O N T E N T O R I E N T E D Team primarily skilled in PHP, little to no experience in JavaScript P H P - C E N T R I C T E A M Solid APIs already available in the CMS R O B U S T E X I S T I N G A P I s To test the product present it at a major industry event S H O R T T I M E T O M A R K E T
  • 6. The Final Solution BFF built to serve the frontend consuming existing APIs Powered by CloudFront, Lambda, and Bref delivering everything at the edge, with no traditional hosting SSR allowed also to deliver a fast, seamless user experience similar SSR to preserve SEO performance and prevent loss in search engine visibility B A C K E N D F O R F R O N T E N D S E R V E R - S I D E R E N D E R I N G S P A - L I K E E X P E R I E N C E S E R V E R L E S S A R C H I T E C T U R E
  • 7. A N I N T R O D U C T I O N Server-Side Rendering
  • 10. JS is not a bad guy but this doesn't necessarily mean it has to be used for everything. SSR allows to use JS for what it is made for: user interactions It can be integrated into existing applications incrementally, without rewriting everything from scratch No multiple stacks and codebases to maintain, evolve and keep updated Ensure a single source of truth for State management to avoid inconsistent data, increased complexity, overhead, unclear separation of concerns R E D U C E J S U S A G E 01 S T A T E C E N T R A L I Z E D 02 S I N G L E S T A C K 03 E A S Y I N T E G R A T I O N 04 Why SSR in PHP?
  • 11. A set of tools and conventions that let you progressively enhance server-rendered templates using JavaScript, without adopting a full SPA framework. It integrates closely with Twig, Stimulus (for interactivity), and Turbo (for navigation and updates) A full-stack framework for Laravel that lets you build interactive components using Blade and PHP. It can be enhanced with Alpine.js for small frontend behaviors, without requiring a full JavaScript framework What does the PHP ecosystem offer for SSR?
  • 12. Is there a pattern we can follow? Yep. It is very common in the Javascript world and it is called: Component-Based Architecture More info: https://ux.symfony.com/cookbook/component-architecture
  • 13. Composition Independence Props State Composition A page is no longer just a page but rather a collection of small, reusable components
  • 14. Composition Independence Props State Independence The component lives in its own context. It should not be aware of the rest of the page
  • 15. Composition Independence Props State Props The component must remain independent, but we can customize its props. Props flow in one direction, from parent to child
  • 16. Composition Independence Props State State A state is pretty much like a prop, but the main difference is that a state can change during the life of the component
  • 17. L I V E W I R E A N D S Y M F O N Y U X I N A N U T S H E L L Quickstart
  • 20. Create a template layout It requires an HTML layout for components to render inside Components are rendered inside traditional Twig blocks
  • 21. Create a route Livewire components can be registered as routes Components are rendered inside traditional Symfony routes
  • 22. Create a component Components are PHP classes that inject properties to a template
  • 23. Create a component Components are PHP classes that inject properties to a template
  • 24. Create an anonymous component Components that don't require any custom logic beyond the properties injected
  • 25. Cool, but… everything is static so far. What about interactions?
  • 27. Live components Components that allows their own state to change during the component lifecycle
  • 28. How does it work under the hood?
  • 29. Live components Components that allows their own state to change during the component lifecycle
  • 30. How does it work under the hood?
  • 31. Interaction with parent components We can rely on events
  • 32. Interaction with parent components We can rely on events
  • 34. SPA-like Navigation Livewire will prevent the standard handling of the link click and replace it with its own, faster version
  • 35. SPA-like Navigation Thanks to Turbo library, Symfony watches for link clicks and form submissions, performs them in the background, and updates the page without doing a full reload.
  • 36. Forms Livewire provides loads of helpful utilities for building them
  • 37. Forms Turbo Drive automatically converts form submissions to AJAX calls. To get it to work, you do need to adjust your code to return a 422 status code on a validation error
  • 39. Kind of hard to test with all this interaction, isn’t it?
  • 42. Still Not Enough? Craving More?
  • 43. Want to take them to the next level? Pre-built Live Components let you add dynamic, reactive UI features without writing JavaScript — just use PHP and Twig Volt is a functional API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to coexist in the same file
  • 44. Integrating with JS libraries
  • 45. K E Y T A K E A W A Y S B E F O R E Y O U G O Wrapping Up
  • 46. • • • • We faced several challenges along the road: performances overweight states shared sessions to allow coexistence with legacy website during the migration Octane memory leaks I T W A S N ' T A L L S M O O T H 02 The context mattered. Native Tailwind support and a Laravel-skilled team made all the difference W E O P T E D F O R L A R A V E L 01 Key Takeaways
  • 47. SSR works best when when you need fast initial load, great SEO, or simple user flows (eg. content platforms). SPA fits better when complex client-side interactivity is the priority — like real-time collaboration or design tools. The key is not ideology, but context S S R I S N ' T A O N E - S I Z E - F I T S - A L L S O L U T I O N 04 SSR in PHP is not just for new projects. It works well even in existing apps. You can start small, one component at a time, without rewriting everything N O T J U S T F O R G R E E N F I E L D P R O J E C T S 03 Key Takeaways