title: Vue router use keep-alive to cache certain components?
body: <p>I have started working with vue recently, and I have managed to create some simple pages, but I have noticed that the component once loaded are not cached, therefore for example on link below (which is what I am working on) youtube videos take time to load, and if I click on any other link and come back to videos they are loaded again.</p>
  
  <p>Is it possible to use  to cache components? preferably all of them instead of 1 by 1.</p>
  
  <p>Here's my vue:</p>
  
  <pre><code>import VueRouter from 'vue-router';
  import Create from '../components/homepage/create.vue';
  import How from '../components/homepage/how.vue';
  import About from '../components/homepage/about.vue';
  import Youtube from '../components/homepage/youtube.vue';
  import Navigation from '../components/homeNavigation.vue';
  import Login from '../components/auth/login.vue';
  import Register from '../components/auth/register.vue';
  
  
  const routes = [
      { path: '/create', component: Create },
      { path: '/how', component: How },
      { path: '/about', component: About},
      { name: 'youtube', path: '/youtube', component: Youtube},
      { path: '/login', component: Login},
      { path: '/register', component: Register},
  ];
  
  Vue.use(VueRouter);
  Vue.component('navigation', Navigation);
  
  const router = new VueRouter({
      routes,
  });
  
  new Vue({
      el: '#app',
      router,
      updated: function () {
          Pace.restart()
      },
      mounted: function() {
          Pace.restart()
      }
  });
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;div id="app"&gt;
          &lt;navigation&gt;&lt;/navigation&gt;
              &lt;transition appear name="slide-fade" mode="in-out"&gt;
                  &lt;keep-alive include='youtube'&gt;
                      &lt;router-view&gt;&lt;/router-view&gt;
                  &lt;/keep-alive&gt;
              &lt;/transition&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My app:</p>
  
  <p><a href="http://b2750916.ngrok.io/#/youtube" rel="noreferrer">http://b2750916.ngrok.io/#/youtube</a></p>