rtCamp/pwa-extension

[PWA] Precache active menu pages when the site is accessed.

pradeep910 opened this issue · 5 comments

Precache Header Menu Pages when homepage is accessed.

Continuing this - https://github.com/rtCamp/labs/issues/7#issuecomment-567884779

Development notes -

  1. Since sites can have any number of pages, we can provide an option to select menus to precache, so that on homepage access, other links can be precached and made available offline for later use.
  2. Precache should also have a limit of 10 pages / links so as to make it performant.

@pradeep910 Can we close this issue?

@chandrapatel I see external links getting added in precache. Please exclude external links from this.

See screenshot below -
Screenshot 2019-12-26 at 2 02 48 PM

@chandrapatel I see external links getting added in precache. Please exclude external links from this.

See screenshot below -
Screenshot 2019-12-26 at 2 02 48 PM

@pradeep910 I have fixed the issue. Please review PR #12

@pradeep910 Precache uses CacheFirst strategy so any page which updates time to time like a blog page. It won't be updated if its precaches. Because it always serves from the cache.

So we need to cache the pages which won't be updated from time to time like recent posts and menu links like about us and etc.

The response strategy used in this route is cache-first: the precached response will be used, unless that cached response is not present (due to some unexpected error), in which case a network response will be used instead.

https://developers.google.com/web/tools/workbox/modules/workbox-precaching#serving_precached_responses

We have merged #12 so closing this.