Smaller HTML payloads

Hi,

I read this article by Philip Walton, and wonder if anyone has made something similar with Netlify Function. If not, would it be possible?

Thanks,

Tom

Hi! Some tips:

  • Please make sure that, before you post a feature request, you looked around to see if it already exists. We may already be working on it.
  • If it does, please post in that thread instead of starting a new one.
  • If it doesn’t, please provide as much information as you can on why we should consider your feature request: How does it benefit you & others? (how does it make our services better, save people money, is safer, more stable, or is otherwise a fantastic idea?)

Pitch it to us!

Hi Tom :wave:t2:

Great article. That said, there’s actually nothing preventing you from building and running this sort of setup on Netlify right now. Building a Gatsby site and using gatsby-plugin-offline actually does almost everything listed in that article for you without hardly any setup.

The streaming API bit is not possible on Netlify, but as far as the overall performance bump goes, I’d wager that the gains from that idea are MINIMAL when you’re already using Netlify’s Edge CDN to deliver all the content (I can elaborate on that if you’d like). The general premise of only loading partials is absolutely valid though, and definitely possible – there’s nothing preventing any user from generating both partial and full pages then building a service worker into their client-side that intercepts those calls and only injects the partial instead.

Legitimately, that’s one of the foundational premises behind Gatsby a few other SSG’s anyway. They do it in the application tier rather than the service worker tier, but the idea is the same and that plugin I mentioned actually does use the service worker tier.

A word of warning. Bugs and issues can get really complicated when using service workers. Be very, very careful to understand where things are happening when using a SW, and take the time to learn the support tooling very well. It’s still somewhat new and so is the tooling. It’s easy to get frustrated working with SW’s :slight_smile:


Jon

@jonsully, thanks for the great response and the Gatsby tip! I am primarily interested in offline functionality, but the added benefit of more granular (caching) control is not lagging far behind. It is definitely an area worth exploring. /Tom

1 Like