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
522a4ea3
Commit
522a4ea3
authored
May 12, 2021
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache the loading hints partial
Caches the loading_hints partial on a short TTL.
parent
6da49550
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
app/views/layouts/_loading_hints.html.haml
app/views/layouts/_loading_hints.html.haml
+11
-10
config/feature_flags/development/cached_loading_hints.yml
config/feature_flags/development/cached_loading_hints.yml
+8
-0
No files found.
app/views/layouts/_loading_hints.html.haml
View file @
522a4ea3
-
if
ActionController
::
Base
.
asset_host
%link
{
rel:
'dns-prefetch'
,
href:
ActionController
::
Base
.
asset_host
}
%link
{
rel:
'preconnect'
,
href:
ActionController
::
Base
.
asset_host
,
crossorigin:
''
}
-
if
user_application_theme
==
'gl-dark'
%link
{
{
rel:
'preload'
,
href:
stylesheet_url
(
'application_dark'
),
as:
'style'
},
ActionController
::
Base
.
asset_host
?
{
crossorigin:
'anonymous'
}
:
{}
}
-
else
%link
{
{
rel:
'preload'
,
href:
stylesheet_url
(
'application'
),
as:
'style'
},
ActionController
::
Base
.
asset_host
?
{
crossorigin:
'anonymous'
}
:
{}
}
%link
{
{
rel:
'preload'
,
href:
stylesheet_url
(
"highlight/themes/#{user_color_scheme}"
),
as:
'style'
},
ActionController
::
Base
.
asset_host
?
{
crossorigin:
'anonymous'
}
:
{}
}
-
if
Gitlab
::
CurrentSettings
.
snowplow_enabled?
&&
Gitlab
::
CurrentSettings
.
snowplow_collector_hostname
%link
{
rel:
'preconnect'
,
href:
Gitlab
::
CurrentSettings
.
snowplow_collector_hostname
,
crossorigin:
''
}
=
cache_if
(
Feature
.
enabled?
(
:cached_loading_hints
,
current_user
),
[
ActionController
::
Base
.
asset_host
,
user_application_theme
,
user_color_scheme
],
expires_in:
1
.
minute
)
do
-
if
ActionController
::
Base
.
asset_host
%link
{
rel:
'dns-prefetch'
,
href:
ActionController
::
Base
.
asset_host
}
%link
{
rel:
'preconnect'
,
href:
ActionController
::
Base
.
asset_host
,
crossorigin:
''
}
-
if
user_application_theme
==
'gl-dark'
%link
{
{
rel:
'preload'
,
href:
stylesheet_url
(
'application_dark'
),
as:
'style'
},
ActionController
::
Base
.
asset_host
?
{
crossorigin:
'anonymous'
}
:
{}
}
-
else
%link
{
{
rel:
'preload'
,
href:
stylesheet_url
(
'application'
),
as:
'style'
},
ActionController
::
Base
.
asset_host
?
{
crossorigin:
'anonymous'
}
:
{}
}
%link
{
{
rel:
'preload'
,
href:
stylesheet_url
(
"highlight/themes/#{user_color_scheme}"
),
as:
'style'
},
ActionController
::
Base
.
asset_host
?
{
crossorigin:
'anonymous'
}
:
{}
}
-
if
Gitlab
::
CurrentSettings
.
snowplow_enabled?
&&
Gitlab
::
CurrentSettings
.
snowplow_collector_hostname
%link
{
rel:
'preconnect'
,
href:
Gitlab
::
CurrentSettings
.
snowplow_collector_hostname
,
crossorigin:
''
}
config/feature_flags/development/cached_loading_hints.yml
0 → 100644
View file @
522a4ea3
---
name
:
cached_loading_hints
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61609
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/330802
milestone
:
'
13.12'
type
:
development
group
:
group::source code
default_enabled
:
false
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