Let's say I have a PWA where two routes are SSR'ed (/dashboard and /logs) and each of those pages load a script preact.bundle.mjs. When the user visits first /dashboard the script gets downloaded, parsed and evaluated. After navigating to /logs I know the script gets picked up from cache, but does it get parsed and evaluated again?
If the app would have been an SPA the script would not be re evaluated again, hence saving time and CPU cycles?
Is there a way to combine the benefits of both, e.g.: fast rendering due to SSR, but avoid re-evaluation of scripts on navigation events like in SPAs? Maybe with a careful orchestration of a Service Worker that would extract relevant fragments of HTML from the server response and patch the page?
If the app would have been an SPA the script would not be re evaluated again, hence saving time and CPU cycles?
Is there a way to combine the benefits of both, e.g.: fast rendering due to SSR, but avoid re-evaluation of scripts on navigation events like in SPAs? Maybe with a careful orchestration of a Service Worker that would extract relevant fragments of HTML from the server response and patch the page?