web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Unable to use Service Worker (JavaScript) in Customer Service Workspace MDA App

(2) ShareShare
ReportReport
Posted on by 7
Unable to use Service Worker (JavaScript) in Customer Service Workspace MDA App
 
Hi, I am trying to implement HTTP Caching using JavaScript Service Workers, as we have a external file which is 90+ mb in size and its not feasible to download it (using API) all the time, So i want to implement HTTP caching but when i wrote script for Service Worker, Its getting installed and activated properly but its unable to catch fetch calls, Is their any restriction in D365 or is their any other way to cache resources ?
 
Service Worker Script is working fine in normal react application in localhost (system) but its only failing to work in D365 MDA app.

Any help would be appreciated.
 
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,538 Super User 2025 Season 2 on at
    Hi there! Good morning, evening, or afternoon - depending on where you are :) Hope you are well today! 
     
    • Here are some insights and suggestions to help you:
      • Restrictions in Dynamics 365: Dynamics 365 applications often run in a sandboxed environment with strict security policies. These restrictions may prevent Service Workers from intercepting fetch calls or functioning as expected. This could explain why your script works in a local React application but not in the D365 MDA app.
      • Alternative Caching Approaches: If Service Workers are restricted, consider these alternatives:
        • Browser Cache: Use HTTP headers like Cache-Control and ETag to leverage the browser's built-in caching mechanism.
        • IndexedDB or LocalStorage: Store the external file locally using IndexedDB or LocalStorage. While these methods have limitations (e.g., storage size), they can be effective for caching smaller resources.
        • Custom API Proxy: Implement a server-side proxy to manage caching and serve the file efficiently.
      • Check Documentation and Community Forums:
        • Review the official documentation for any notes on Service Worker limitations in Dynamics 365.
        • Engage with the Dynamics 365 community forums, where others may have faced and resolved similar issues.
      • Debugging Tips:
        • Use browser developer tools to inspect network requests and ensure that the Service Worker is correctly registered and activated.
        • Check for any errors or warnings in the console that might indicate why fetch calls are not being intercepted.
  • Koushil Mankali Profile Picture
    7 on at
    Hi @Holly Huffman, thank you for the quick reply,

    1) Actually we are using external library, so we don't have control over fetch calls made from the library, so we cant go with local storage or indexed db.
    2) The files we are trying to fetch are approximately 80 MB in size so browser will not cache them automatically, even though we have cache control headers.
    3) I have tried a lot to find out something related to service workers in D365 in the documentation, but sadly unable to find any.
     
    Do you have any article or documentation link related to same ?, If so can you please share that here.

    Thank you,
    Koushil Mankali.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 45 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans