REST "list releases" API doesn't split cache key on include_html_description

I note that, if you don't include ?include_html_description=true in your request, then subsequent requests with the parameter won't have the rendered description for the next 5 minutes!

We might need to use something like this:

diff --git a/lib/api/releases.rb b/lib/api/releases.rb
index dc84d1ca4ffa..ed816bb94363 100644
--- a/lib/api/releases.rb
+++ b/lib/api/releases.rb
@@ -112,7 +112,7 @@ class Releases < ::API::Base
           # `current_user` could be absent if the releases are publicly accesible.
           # We should not use `cache_key` for the user because the version/updated_at
           # context is unnecessary here.
-          cache_context: ->(_) { "user:{#{current_user&.id}}" },
+          cache_context: ->(_) { "user:{#{current_user&.id}}:#{Gitlab::Utils.to_boolean(declared_params[:include_html_description])}" },
           expires_in: 5.minutes,
           current_user: current_user,
           include_html_description: declared_params[:include_html_description]
Edited Feb 06, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading