Skip to content

Conversation

@Vincentdevreede
Copy link
Contributor

This PR refactors the proxy factory to lazy-load and cache module imports on first use, and introduces a safe default for missing proxy configuration.

Changes

  • Deferred require() calls for fast-proxy-lite, http-lambda-proxy, and fast-proxy until their branch is invoked
  • Cached each imported module in the closure to prevent redundant loads
  • Added route.proxyConfig || {} fallback
  • Replaced the if/else if/else proxyType checks with a switch(proxyType)

No functional changes—internal refactor only.

@Vincentdevreede Vincentdevreede changed the title Refactor/lazyload proxy factories refactor(proxy): improve proxy factory implementation with lazy loading May 7, 2025
Copy link
Collaborator

@jkyberneees jkyberneees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR contain linting issues, please fix accordingly.

@jkyberneees jkyberneees merged commit 2f695e5 into BackendStack21:master May 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants