Skip to content

How to create custom cacheKey? #133

Answered by MarcGiffing
gijsdh asked this question in Q&A
Discussion options

You must be logged in to vote

The root object in the expression is the HttpServletRequest object. It's properties are accessed directly:

cache-key=getAttribute("id")

  • servlet: jakarta.servlet.http.HttpServletRequest (e.g. getRemoteAddr() or getRequestURI())
  • webflux: org.springframework.http.server.reactive.ServerHttpRequest
  • gateway: org.springframework.http.server.reactive.ServerHttpRequest

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MarcGiffing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants