PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

SSR increases page speed

Solved
hamburger-fries

Nov 12th, 2024 03:32 AM

Is there a way in future Wave releases all JS code us SSR?

SSR cuts down on the client side loading JS by 60% or more.

I know when installing Inertia you can set a flag —ssr when installing.

https://inertiajs.com/server-side-rendering

bobbyiliev

Nov 12th, 2024 03:44 AM

Best Answer

Hey!

As far as I know out of the box, Livewire doesn’t support SSR in the same way that Inertia or Next.js do.

Livewire uses server requests to handle dynamic updates without reloading the page, but it does not pre-render pages on the server for faster initial load times.

Also Wave uses Volt. Laravel Volt focuses on Blade components, Livewire, and Alpine.js, optimizing interactivity without the need for a full JavaScript frontend framework. It’s designed to be lightweight but doesn’t support traditional SSR.

Seems like someone has has wrote a post about SSR with Livewire but I've not tested it out and is not a straight forward as the --ssr flag in Intertia:

https://www.thecodingdev.com/2024/08/implementing-server-side-rendering-ssr.html

With Livewire, what will help is running the following to cache your views:

php artisan optimize

Also cache the blade icons with:

php artisan icons:cache 

And also optimize Filament with:

php artisan filament:optimize

Hope that this helps!

- Bobby

Report
1
hamburger-fries

Nov 12th, 2024 05:28 AM

Wow this is fantastic! Also thanks for turning me on to this!!!

https://www.thecodingdev.com

Report
1
bobbyiliev

Nov 12th, 2024 05:40 AM

No problem! Good luck with your project!