Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cf0390e9
Commit
cf0390e9
authored
Feb 14, 2022
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable caching on tags API
Changelog: performance
parent
f536b8cd
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
177 deletions
+147
-177
config/feature_flags/development/api_caching_tags.yml
config/feature_flags/development/api_caching_tags.yml
+0
-8
lib/api/tags.rb
lib/api/tags.rb
+1
-5
spec/requests/api/tags_spec.rb
spec/requests/api/tags_spec.rb
+146
-164
No files found.
config/feature_flags/development/api_caching_tags.yml
deleted
100644 → 0
View file @
f536b8cd
---
name
:
api_caching_tags
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54975
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/324391
milestone
:
'
13.10'
type
:
development
group
:
group::source code
default_enabled
:
false
lib/api/tags.rb
View file @
cf0390e9
...
...
@@ -33,11 +33,7 @@ module API
paginated_tags
=
Gitlab
::
Pagination
::
GitalyKeysetPager
.
new
(
self
,
user_project
).
paginate
(
tags_finder
)
if
Feature
.
enabled?
(
:api_caching_tags
,
user_project
,
type: :development
)
present_cached
paginated_tags
,
with:
Entities
::
Tag
,
project:
user_project
,
cache_context:
->
(
_tag
)
{
user_project
.
cache_key
}
else
present
paginated_tags
,
with:
Entities
::
Tag
,
project:
user_project
end
present_cached
paginated_tags
,
with:
Entities
::
Tag
,
project:
user_project
,
cache_context:
->
(
_tag
)
{
user_project
.
cache_key
}
rescue
Gitlab
::
Git
::
InvalidPageToken
=>
e
unprocessable_entity!
(
e
.
message
)
...
...
spec/requests/api/tags_spec.rb
View file @
cf0390e9
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment