Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code and config #7840

Merged
merged 14 commits into from
Oct 7, 2024
Merged

Simplify code and config #7840

merged 14 commits into from
Oct 7, 2024

Conversation

nathphon
Copy link
Contributor

@nathphon nathphon commented Oct 7, 2024

Simplify HTTP responses and update application properties

Removed redundant response headers and simplified the WebFlux router function for basic GET and POST routes. Additionally, disabled the Spring banner and reduced logging verbosity in application properties.

nathphon.jeamjit and others added 14 commits September 24, 2024 17:20
Replaces the annotation-based controller with a functional routing approach. Introduces a `RouterFunction` bean to handle HTTP requests, eliminates redundant response creation, and improves efficiency by directly parsing path variables.
Simplified the route definitions by using lambda expressions directly in the RouterFunction. This reduces unnecessary method declarations and enhances readability.
This change aligns the class name with its intended functionality. The class was previously named incorrectly, which could cause confusion. The new name clarifies its role as a controller within the Spring WebFlux framework.
This change corrects a package naming inconsistency in the BenchmarkController class. The package was previously listed incorrectly as "router" and has been updated to "controller" to reflect its actual content and functionality.
Added a 15-second cache control to key GET endpoints in `BenchmarkController`. Enhanced Netty server settings for performance, including connection and idle timeouts, header validation, buffer size, and response compression.
Updated EMPTY_RESPONSE and user/{id} route to exclude DATE and SERVER headers. This change improves security by not exposing server information and standardizes response headers.
Removed unnecessary DATE header manipulations and streamlined SERVER header removal in response preparation. Changed content type to TEXT_PLAIN and added shared caching logic for consistent behavior.
Removed HttpHeaders.CONNECTION for added security in response headers. Enabled HTTP/2 and adjusted connection and idle timeouts in application properties for optimized server performance. Changed root logging level from ERROR to WARN to capture more detailed logs.
This commit eliminates the `CacheControl` mechanism from the `BenchmarkController`. The `maxAge` duration and related caching properties were removed for both the empty response and the user-specific response. This change might impact performance and response handling in caching-sensitive environments.
Replaced CacheControl and Duration imports with HttpHeaders and MediaType imports. This change addresses unnecessary imports and streamlines the code dependencies.
Removed redundant response headers and simplified the WebFlux router function for basic GET and POST routes. Additionally, disabled the Spring banner and reduced logging verbosity in application properties.
Added configuration properties to disable Netty leak detection and header validation in `application.properties`. This change is intended to optimize server performance and reduce unnecessary debugging output.
@waghanza waghanza merged commit d44172a into the-benchmarker:master Oct 7, 2024
2 checks 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