Are service workers suitable to cache assets from other pages than the one active?

I’m considering to learn and use service workers to speed up a website I’m currently developing. It’s a full custom wordpress site, theme made from zero by me.

I’ve got some big js and css assets to manage. In detail:

  • one big ‘shared’ css, and the a lot of page-specific smaller ones

  • one big ‘shared’ js, and the a lot of page-specific smaller ones

  • another big ‘semi-shared’ js, which I use only for some pages (where I built a couple of mini Vue apps)

In particular, I’m interested in caching the last one, the ‘semi-shared’, in background while and when the user is navigating other pages that don’t use it, so that when users evcentually come to the vue mini apps, js are already loaded.

So basically, example, while I’m visiting /home or other pages, service workers should load the assets needed for /vue-app. Are the service workers suitable for this?