how to turn off timestamp in next.js module federation remote entry call

75 views Asked by At

I am using next.js with module federations. modules are defined as header, footer, and the rest of the page. here header and footer comes from different next.js app using module federation. and it gets plugged into the main app to render the whole page using next.js's dynamic api

package used: @module-federation/nextjs-mf@^7.0.7

now with every render, the app calls this footer app url to fetch the remote entry file. but along with that, it also passes a timestamp. how do I stop this time stamp? this effects caching a lot.

following is the next.config for main app

{
  ...other next.js configs,
  config.webpack = (webpackConfig, { isServer }) => {
    const location = isServer ? "ssr" : "chunks";
    remotes: {

      headerComponentApp: {
        "headerComponentApp": `headerComponentApp@${process.env.HEADER_APP_URL}/_next/static/${location}/remoteEntry.js`
      }
      ...
    }
  }
}

url format on request: https://www.headerapp.io/_next/static/chunks/remoteEntry.js?1702317443113

where 1702317443113 is auto generated ts, which I want to get rid of.

0

There are 0 answers