App always open in responsive web offline

0
Hello everyone, I have implemented offline functionality in my Mendix app and created an offline web profile. I have set everything up and it functions correctly in my local environment. However, when I deploy the application to the cloud and attempt to log in, I am consistently redirected to the offline profile even when an internet connection is present. I have attempted to resolve this issue by clearing the browser's history and cache, but nothing seems to work. Does anyone have any suggestions on how to redirect to the online profile or switch between online and offline profiles? Any input would be greatly appreciated. Thank you in advance.
asked
1 answers
0

Hi Bhanu,

What you're seeing is usually related to how the browser remembers the last selected profile for an Offline Web app.

Since Offline Web uses service workers and local caching, I've seen situations where the browser continues loading the offline profile even when the device is online. This is especially noticeable after the app has been opened once in offline mode.

A few things I'd verify:

  • Check the application's Default home web profile configuration.
  • Open the application in an incognito/private browser window and see whether it still opens the Offline profile.
  • Inspect the browser's Application tab (DevTools) and check whether old service workers are still registered.
  • Verify whether the URL being opened contains a profile parameter or redirect logic.

If your requirement is:

  • Online users → Responsive profile
  • Offline users → Offline Web profile

then a practical approach is similar to what Daniel described:

  1. Start in the Offline profile.
  2. On page load, check connectivity.
  3. If online, redirect to:


Plain Text



?profile=Responsive

  1. If offline, remain in the Offline profile.

I've used a similar pattern because profile selection isn't automatically switched once the Offline Web profile has loaded.

One additional test: deploy a very small page in the Responsive profile and navigate directly to:


Plain Text



https://<app-url>/?profile=Responsive

If that works consistently, then the issue is likely related to profile selection/caching rather than authentication or deployment.

Since it works locally but behaves differently in the cloud, I'd especially investigate service worker cache and stored profile selection in the browser before looking at the application logic itself.

Hope this helps.


answered