storefront icon indicating copy to clipboard operation
storefront copied to clipboard

Service-Worker-side rendering 😮

Open leomp12 opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

  • Some EJS partials are not (and should not be) fully hydrated client side (eg.: shelfs);
  • Can't deal with full Jamstack and tons of products/categories/brands pages, so we have problems to deploy to Netlify and now specially to Cloudflare Pages (without workers);
  • ISG is good but not so easy to control versions, A/B tests and cache as Jamstack with low cost and high perf;

Describe the solution you'd like Two-level EJS rendering, full prerender some limited pages as fallback and also render EJS first level only (custom delimiters <$= $>) to be final level (<%= %>) rendered on SW for all pages with SW cache low TTL.

Describe alternatives you've considered N/A

Additional context https://javascript.plainenglish.io/an-introduction-to-service-worker-side-templating-858b835d5062 https://github.com/unjs/h3

leomp12 avatar Sep 21 '21 18:09 leomp12

https://astro-sw-demo.netlify.app/blogs/1 (https://github.com/thepassle/astro-service-worker) 👀

leomp12 avatar May 16 '22 19:05 leomp12