Giter Club home page Giter Club logo

Comments (4)

maxmilton avatar maxmilton commented on May 21, 2024

What kind of changes are you making to your index.html? Typically with a SPA you leave it quite bare and instead use the framework to inject the content or change any meta tags etc.

from pwa.

lili21 avatar lili21 commented on May 21, 2024

the filename of js and css ? everytime I change my code, the filename( hash ) will be changed, and the reference in index.html will be updated.

from pwa.

dewdad avatar dewdad commented on May 21, 2024

Has any progress been made on this issue?

from pwa.

jeffposnick avatar jeffposnick commented on May 21, 2024

Using a cache-first approach for navigation requests offers a meaningful performance benefits See "High-performance service worker loading" for more details.

The strategy that Vue PWA's service worker uses is effectively a stale-while-revalidate approach, with the "stale" content shown initially, and then refreshed in the background if there are updates detected in the service worker. The subsequent visit should result in the fresh HTML being displayed.

While you could get some offline-fallback benefits from using a different strategy for navigation requests, like a strategy which went to the network first and only displayed cached HTML when the network request failed, you lose the performance benefits.

It's unlikely that we're going to change that strategy for this template, but if you'd like an alternative approach, starting with the basic webpack template and then adding-in either a service worker library or just some handwritten service worker code to implement a network-first strategy is definitely an option. The Offline Cookbook is a great resource when you're writing your own service worker.

from pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.