Route component with version app


#1

Hi,

I use framework with vue.

I want to force refresh cache when a new app version is deployed. I valorize the version with the parameter f7params.version.

Is it possible to force refresh cache web navigator only a new version app is deployed ? Or other solution ?

Example my route.js :

import AboutPage from './components/about/about.vue';
import HomePage from './pages/home/home.vue';
export default [
{
  path: '/',
  redirect: {
    name: "home"
  }
},
{
  path: '/about/',
  component: AboutPage
},
{
  name: "home",
  path: '/home/',
  component: HomePage
},....

Thanks for your responses.


#2

how do you get if there is a new version? you are talking about new version of your deployed app ?


#3

It’s a new version for my app when i refresh my source code (front office), the mobiles navigators don’t refresh front office. I have to empty the cache for to have the good code.
How to force the code refresh ?
I tried with the parameter “f7params.version”, but there has nether reaction.


#4

If you use PWA and service worker check this topic iOS 12.2 automatic update of PWA broken? there are some useful blog links with tutorials


#5

Sorry but i’m newbie to the world of technologies vue.js, node.js, webpack, cordova … I am basically a developer PHP and Jquery.
I do not use cordova because i do not understand yet how it works.

So I not use “PWA”.
I develop a simple application for navigator web not a native application.
For a moment, I run my app with “npm run dev” with webpack behind a server apache.


#6

Ok, so if you don’t use service worker. Then the most boilerplate version to invalidate browser cache, is everytime you upload updated app scripts and styles, just add file hash suffix to file name, e.g. app.e452asdzj39123.css