File runtime-service-worker.js?v=2 is causing 404 errors. What is loading this and why it's not found?
Background:
I just moved client's website from development server to production server. After moving the site I found out that Chrome is loading runtime-service-worker.js?v=2 on every page load and it's fetching and caching files. The file is supposed to be located in the root folder ie. my-site.com/runtime-service-worker.js?v=2, but it's actually not there. So I suppose it's generated dynamically or temporarily copied there.
When it occurs:
This happens only in Chrome and I can get some console output only when logged in. The output is kind of debug output of what the file and the script is doing. But even when not logged in, the site tries to load the file and it gives the 404 error.
This didn't happened when the site was on development server. After the site move I have only done some minor code updates in theme files, URL updates and updated WP and some plugins.
This is an issue because the site has 404 detector against bots trying to find vulnerabilities in outdated plugins. When there's enough 404 errors the IP is being blocked. And now some visitors have been blocked because of this problem. I temporarily disabled the 404 detection until this is resolved.
Console output:
Here's some example of the console output, when being logged in:
RTSW: caching my-site.com/?dm_ajaxCall=true in addition to my-site.com/
runtime-service-worker.js?v=2:244 RTSW: fetched and cached:
runtime-service-worker.js?v=2:245 my-site.com/ in druntime-v2_35-site-pages-3675989298-2010869941
runtime-service-worker.js?v=2:244 RTSW: got from cache:
runtime-service-worker.js?v=2:245 my-site.com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1
runtime-service-worker.js?v=2:245 my-site.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.3.2
runtime-service-worker.js?v=2:245 my-site.com/wp-content/plugins/bt_cost_calculator/jquery.dd.js?ver=5.6
runtime-service-worker.js?v=2:245 my-site.com/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.70
What have I tried so far:
The site is using my own theme and it doesn't include this file or the script. I have disabled every plugin one by one, but no luck.
I tried googling this, but couldn't find any relateble info.
Any help is appreciated.
Edit: Found the reason and workaround solution
Answer is found below.