Skip to content

Commit

Permalink
fix(module-federation): do not cache assets from static serve (#27005)
Browse files Browse the repository at this point in the history
We're currently caching files for an hour when serving the host with
static remotes. This PR fixes the issue by setting `cacheSeconds: -1` on
the static server (disables cache).

This affects development only.
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
jaysoo authored Jul 19, 2024
1 parent 83b88a1 commit 8b1c78c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function startStaticRemotesFileServer(
ssl: options.ssl,
sslCert: options.sslCert,
sslKey: options.sslKey,
cacheSeconds: -1,
},
context
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function* moduleFederationDevServerExecutor(
spa: false,
withDeps: false,
cors: true,
cacheSeconds: -1,
},
context
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function startStaticRemotesFileServer(
ssl: options.ssl,
sslCert: options.sslCert,
sslKey: options.sslKey,
cacheSeconds: -1,
},
context
);
Expand Down Expand Up @@ -267,6 +268,7 @@ export default async function* moduleFederationDevServer(
withDeps: false,
spa: false,
cors: true,
cacheSeconds: -1,
},
context
)
Expand Down

0 comments on commit 8b1c78c

Please sign in to comment.