Common dependencies and code for microservices at Hi!t-Consulting
The RequestLoggingFilter
logs outgoing responses. It logs the following information:
200 | 12.94 ms | GET /api/v1/user/me
(1) (2) (3)
- HTTP status code
- Response time in milliseconds
- HTTP method and path
The CacheAnnotationInterceptor
can add the Cache-Control
header to responses.
To use it, annotate a controller method with @CacheControl
and specify the maxAge
in seconds.
@CacheControl(maxAge = 60)
@GetMapping
public String get() {
return "Hello";
}