NOOBAF
NOOBAF

Reputation: 187

Cache InputStream for annotated methods

I want to cache the input stream of certain endpoints, have been able to achieve this only for all endpoints.

  1. tried creating an interceptor that turns on caching per method annotation
  1. tried recognizing the handler annotation dynamically in the filter

Basically what I want to ask is, is there a way to add an annotation to a controller method that would cache it's request payload without affecting preexisting endpoints on the same base route?

Upvotes: 0

Views: 26

Answers (1)

NOOBAF
NOOBAF

Reputation: 187

Solved

  1. created a request that has a cache() medhod
  2. the filter wrappes all requests in cachableRequest
  3. an interceptor runs the cache() method when annotation is present.

:)

Upvotes: 0

Related Questions