Skip to content

Conversation

@mike-turintech
Copy link
Owner

This commit refactors the cache key generation logic for QueryRequest objects to improve performance and simplicity.

Previously, the key was generated by serializing relevant fields into a JSON string using ObjectMapper and then hashing the JSON. This approach introduced overhead and unnecessary complexity.

The new implementation directly constructs a delimited string (field:value;...) from the request fields using a StringBuilder and hashes this raw string.

Benefits include:

  • Improved performance by avoiding JSON serialization.
  • Simplified key generation logic.
  • Removal of dependency on ObjectMapper within the method.
  • Elimination of JsonProcessingException handling.

Related Jackson imports and the objectMapper field have been removed. The fallback mechanism in case of NoSuchAlgorithmException now returns the raw generated string.

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.

3 participants