Next-pwa: Cache SSG pages

Created on 6 May 2020  路  4Comments  路  Source: shadowwalker/next-pwa

We have about 120 SSG pages in our application which isn't too much data to transfer over the network. It would be nice to add all SSG JSON data to the service worker so every page is cached automatically.

It might be interesting to introduce some limits as how much it should be able to cache here, for example, we only the x-first pages of getStaticPaths for a page for example.

enhancement

Most helpful comment

I don't believe SSG pages are prefetched, there only is runtime caching. The issue is about prefetching those pages :)

All 4 comments

Help me understand the request here, what is SSG page?

My guess is setting expiration.maxEntries in runtimeCaching would help:
https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-expiration.ExpirationPlugin#ExpirationPlugin

Static Site Generation (SSG), the new big feature in 9.3.

The idea would be to proactively cache all the generated page data.

@paales I use the SSG mode with NextJS 9.3, all working good for me, you can confirme that?

I don't believe SSG pages are prefetched, there only is runtime caching. The issue is about prefetching those pages :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yhay81 picture yhay81  路  5Comments

adammesa picture adammesa  路  8Comments

LucasMallmann picture LucasMallmann  路  4Comments

flamedmg picture flamedmg  路  4Comments

efleurine picture efleurine  路  7Comments