I used middleware to support multi-tenant (middleware rewrites user's requests to it's organization's page)
it's the abridged version of the middleware:
We wanted to cache the viewport, organization(host), and the path.
The point is that next-translate rewrite request to its language (If we don't specify any languages it sends the user to /default language)
And the problem is that in offline mode when we can see the cached root page it tries to get the default page and it causes a non-stop refresh on the page.
I set dynamicStartUrlRedirect: '/default' in PWA config
I tried additionalManifestEntries too
Actually, it cached the default page but doesn't use it!
In the online mode:
Summary
I'm using Next-PWA and Next-translate
I used middleware to support multi-tenant (middleware rewrites user's requests to it's organization's page) it's the abridged version of the middleware:
We wanted to cache the viewport, organization(host), and the path.
The point is that next-translate rewrite request to its language (If we don't specify any languages it sends the user to /default language)
And the problem is that in offline mode when we can see the cached root page it tries to get the default page and it causes a non-stop refresh on the page.
I set dynamicStartUrlRedirect: '/default' in PWA config I tried additionalManifestEntries too Actually, it cached the default page but doesn't use it! In the online mode:![image](https://github.com/shadowwalker/next-pwa/assets/53149360/8495ebbb-48cd-40b5-b03e-7151e2063df3)
In the offline mode(With non-stop refresh):![image](https://github.com/shadowwalker/next-pwa/assets/53149360/64e80664-4bcc-405b-affe-486a6612d421)
Here is the cached page:![image](https://github.com/shadowwalker/next-pwa/assets/53149360/9fe37570-1821-419e-a128-df0552e42df1)
Versions
next-pwa
: "^5.6.0",next
:"12.2.0",next-translate
: "^1.4.0",