Search code examples
javascriptservice-workeramp-htmlpostmessage

Send postmessage to ServiceWorker on AMP


I am in a tricky situation. I have a service worker in my page where I can init my cache with a postmessage (so on a new version, without any change on my service worker file, I can add or remove the file from my cache).

But here my problem, I need to do the same thing on amp version on my page. I figured out how to call and register my service worker, but couldn't find a way to make my postmessage call.

Here my question: is there any solution to make a post message call from an AMP page ?


Solution

  • if somebody as the same problematic here how I solve it : No more postMessage, as it's impossible to do in AMP be i store data in a json file in my server and Service worker ask the file (without any cache) to get my data