You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, only the HTML-formatted responses are cached. The cache time is per document, and once the cached entry expires then the next request causes a full regeneration. Requests for JSON-formatted data are always generated fresh on every request.
The HTML-formatted responses will no longer be displayed in the Cryostat web UI, but it may be nice for some users to still have this API present, so this code path should not be removed (yet). We should, however, apply some caching strategy to the JSON side of things.
My initial thought is to set up the cache so that each entry has a key like <JVM_ID, Rule_ID>, and a value like <Rule_ID, Rule_Name, Rule_Description, Rule_Category[], Rule_Score>. The key JVM_ID is the unique hash ID for the target that the analysis was performed against and the Rule_ID is of course the ID for the specific analysis rule that was evaluated.
This way, the client can continue to request specific rule evaluations by query parameter. The client and server can negotiate a caching strategy using standard HTTP headers like Cache-Control, If-Modified-Since/If-Unmodified-Since, and Last-Modified. If all of the client's requested analyses are already in the cache and are fresh enough then the server simply responds with those values. If any of the requested analyses are either not in the cache or are not fresh enough then the server re-analyzes all of the requested rules (so that the response has a consistent data age/freshness across all metrics), updates the cache, and responds to the client. The server should also have its own policy for maximum cache entry age and a maximum cache size/weight as well to ensure that the key space doesn't grow too large and waste server resources.
The text was updated successfully, but these errors were encountered:
https://github.com/cryostatio/cryostat/issues/880#issuecomment-1156753942
Currently, only the HTML-formatted responses are cached. The cache time is per document, and once the cached entry expires then the next request causes a full regeneration. Requests for JSON-formatted data are always generated fresh on every request.
cryostatio/cryostat-web#949
The HTML-formatted responses will no longer be displayed in the Cryostat web UI, but it may be nice for some users to still have this API present, so this code path should not be removed (yet). We should, however, apply some caching strategy to the JSON side of things.
My initial thought is to set up the cache so that each entry has a key like
<JVM_ID, Rule_ID>
, and a value like<Rule_ID, Rule_Name, Rule_Description, Rule_Category[], Rule_Score>
. The keyJVM_ID
is the unique hash ID for the target that the analysis was performed against and theRule_ID
is of course the ID for the specific analysis rule that was evaluated.This way, the client can continue to request specific rule evaluations by query parameter. The client and server can negotiate a caching strategy using standard HTTP headers like
Cache-Control
,If-Modified-Since
/If-Unmodified-Since
, andLast-Modified
. If all of the client's requested analyses are already in the cache and are fresh enough then the server simply responds with those values. If any of the requested analyses are either not in the cache or are not fresh enough then the server re-analyzes all of the requested rules (so that the response has a consistent data age/freshness across all metrics), updates the cache, and responds to the client. The server should also have its own policy for maximum cache entry age and a maximum cache size/weight as well to ensure that the key space doesn't grow too large and waste server resources.The text was updated successfully, but these errors were encountered: