shadowwalker / next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰
MIT License
3.89k stars 325 forks source link

root path requested twice #344

Open PlopTheReal opened 2 years ago

PlopTheReal commented 2 years ago

The root path is requested twice (see the screenshot). Other paths aren't (ie /whatever).

Versions

Expected Behaviors

The root path is requested once.

Screenshots

image

shadowwalker commented 2 years ago

Configure dynamicStartUrl to false. image

PlopTheReal commented 2 years ago

Thanks, this solve the double request but I got another side effect. When the user hit the root path that increase some user statistics (like hit count) but now it seems to skip this logic entirely. I presume that's because it's cached and doesn't hit the server on subsequent requests. How can I prevent the dupplicated requests while still hitting the server on each requests on root?