- Issue created by @Freddy Rodriguez
- ๐ฌ๐งUnited Kingdom gMaximus
So the first thing is that offline viewing isn't complete for this module. I'm in the process of releasing two supporting modules that integrate rules and flag for push notifications. At that point I'll update this module's page with more info on this.
I then plan to work on the device caching. For now this patch should resolve the issue. It does for me.
The offline caching for other pages is already commented out. See line 49 in js/service_worker.js. If you uncomment it, the device caching will work but it needs completing. It's doable on websites where people don't sign into the website. Like your experience here, the cache becomes stale on log in and log out.
I'm going to make an issue where anyone can help move that along. There is a lot of code in the module for it. I've researched passing drupalSettings to the service worker. That needs developing. The first thing I want is a on/off switch for device caching. For my websites, I want to rely on Drupal's caching and am not interested in offline viewing. My excitement was push notifications. My site is an online community.
- ๐ฌ๐งUnited Kingdom gMaximus
I'd like the device caching to work like this.
- option to turn off and on.
- on login/logout, the device cache should be cleared.
- option to configure what gets cached. I envisage the setting to be like configuring a block.Can you pls send me a English version of that AI link?
- ๐ฌ๐งUnited Kingdom gMaximus
@Freddy Rodriguez. I've done a lot of work on the service worker over the last couple of days. With this patch, the device cache is cleared on login and logout. On logout, the page will refresh after the device cache is cleared, it makes the page feel like it lags and I'd love any ideas for how to do it differently. I was frankly losing the will.
I now know how to start passing variables to the service worker. So I feel that page caching settings is not to far off.
If you can, pls test and let me know how you get on.
- Status changed to Closed: duplicate
6 months ago 12:07pm 13 May 2024 - ๐ฌ๐งUnited Kingdom gMaximus
I'm closing this now. The solution for this is in that issue fork.
I've also developed a little more in order to unregister the client-side service worker after uninstalling this module.
Any help you can give testing would be greatly appreciated.