Re-evaluation of scripts in SSR PWAs vs SPA PWAs?

#1
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?
 

serpent_driver

Well-Known Member
#2
This is the wrong forum for your question. You better should use plattforms like https://stackoverflow.com

**********************************************************************************************************************************************************************************
Join https://www.cachecrawler.com - Lightning fast Cache Warmup Crawler for Wordpress, OpenCart, PrestaShop, W3 Total Cache, WP Rocket, Shopware and Magento.

support-partner-label.png
 
Last edited:
Top