Search code examples
progressive-web-appsmobile-application

Is PWA applicable for desktop web application?


I have recently gone through couple of Progressive Web application(PWA) articles on google. What I have got it it is concept for web application which combines best of two world i.e. latest browser features(like web workers etc) and native application(speed, home page etc).

I have two basic doubts .

  1. Is PWA applicable for mobile sites only or for desktop based application also ? In the couple of examples I have gone through mainly talks that using PWA allows the mobile user to user the mobile sites like app without installing and equally good speed.

  2. I understand the point with PWA user does not have to install the native app on his/her mobile but i believe even in case of PWA all content(static content like html,css,jss,images etc) will be stored in cache as user navigates to web application. Service worker checks if content available in cache it will serve it from there otherwise fetch it from server. So when PWA caching the content on client side, it will be equivalent of size of native app. Is n't it ?


Solution

  • Its applicable to both. Think a PWA as a website that gets stored in local cache.

    It really depends on what you configure service workers in the browser to do, but the gist of the thing is:

    • cache HTML, CSS, and JS on the client (usually on a per need basis, load and cache)
    • use browser local database storage to store data coming from your back end database
    • use AJAX, and/or WebSockets to get data back and forth from your back end systems

    Call it a website, a javascript application, whatever you call it, its just the same old/new browser tricks working with local cache introduced; so it loads offline.

    And loading offline is pretty much as close as they come to a native app, PWAs as of today are HTML, CSS, JS applications running on a browser; generically called a website.

    Hope its clear.