Static GitHub Issues

[91] keep-alive - Ability to cache page components on the client

prev: Browser Compatibility
next: Err while using WeUI.js

Hi there,

I have been playing around with the framework and one thing that bugs me is that you can cache pages on the server, but not on the client.

It would be great to be able to use keep-alive (https://vuejs.org/v2/guide/components.html#keep-alive) on top of the router-views that power the pages (as in https://router.vuejs.org/en/api/router-view.html#behavior)

For now, when I wrap the router-view with a keep-alive tag, (https://github.com/nuxt/nuxt.js/blob/master/lib/app/components/nuxt-child.js#L57), it kind of works : the components are properly cached. However, the component's data function is called anyway even if it doesn't reflect on the drawn component.

Do you have any plans on making it possible to use keep-alive ?

Anyway, thanks for Nuxt, and keep up the good work, it's amazing :)

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c72">#c72</a>)</em></sub></div>