angular-architects / module-federation-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A way to bypass browser cache upon requesting remoteEntry.json

pamartinez-signify opened this issue · comments

I've been experiencing some caching issues after deploying a new version of a remote: even though exported modules get random file names, the old ones are still being served from the browser cache.
I am suspecting the old remoteEntry.json is still being served with the old package names, and all being served from browser cache.
I am wondering if there could be an option (maybe an options param added to initFederation()) for remoteEntry.json files to be requested with some random param to force it to always load a fresh version...
i.e: http://localhost:4201/remoteEntry.json?_=1709751014494 <-- this is just +(new Date())

That way, the remoteEntry.json file is always fresh, and as long as it's using same version packages, they will be retrieved from cache. Otherwise, it will get the newer packages with different names.

I think, in general, you should configure your web server to provide HTTP headers preventing caching of the remoteEntry.json and the manifest file.