Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/internal/pages.rb')
-rw-r--r--lib/api/internal/pages.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/api/internal/pages.rb b/lib/api/internal/pages.rb
index 8eaeeae26c2..20ca7038471 100644
--- a/lib/api/internal/pages.rb
+++ b/lib/api/internal/pages.rb
@@ -54,7 +54,15 @@ module API
virtual_domain = host.pages_virtual_domain
no_content! unless virtual_domain
- present virtual_domain, with: Entities::Internal::Pages::VirtualDomain
+ if virtual_domain.cache_key.present?
+ # Cache context is not added to make it easier to expire the cache with
+ # Gitlab::Pages::CacheControl
+ present_cached virtual_domain,
+ cache_context: nil,
+ with: Entities::Internal::Pages::VirtualDomain
+ else
+ present virtual_domain, with: Entities::Internal::Pages::VirtualDomain
+ end
end
end
end