Transcript from the "PRPL Pattern" Lesson
>> Mike North: The second pattern that I wanna talk about, and this isn't a choice between App Shell and this other pattern. But it works well in terms of figuring out how we set up our different resources. This is called PRPL and again coined by Google Developer Advocate, think this was Addy that coined this one.
[00:00:49] And at that point we can render that initial route. So then we can, in the background, pre-cache any remaining route. So this is where you would go and in the background download additional fragments of your application so they're available instantly. That would be kind of the like the pre-caching that we've already been doing.
[00:01:29] And so you can kinda keep them in the cache, from the cache API and they're is sorta inert there, it's just text. And then as you need them, you can send a request for them in your service or send it back to the application. And at that point it becomes code, it's evaluated and you can use it.
[00:01:50] So these are the two goals of PRPL. We're trying to minimize the time-to-interactive by shrinking the code that we send to the browser for a given URL. It's shrinking the CSS so we're not sending all of Twitter Bootstrap along. And we also wanna maximize our caching efficiency by trying to ensure that we have the most critical stuff first.
[00:02:14] So that if the user visits a page and switches to another one. Like you have VIZ first and then you can worry about images in other less prioritized resources later.