Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
fb3d6f17
Commit
fb3d6f17
authored
Aug 03, 2020
by
Markus Scheidgen
Browse files
Added specific cache header for gui resources.
parent
8d9744c5
Pipeline
#79924
passed with stages
in 20 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/app/gui.py
View file @
fb3d6f17
...
...
@@ -12,9 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
flask
import
Blueprint
from
flask
import
Blueprint
,
request
import
os.path
gui_folder
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'../../gui/build'
))
blueprint
=
Blueprint
(
'gui'
,
__name__
,
static_url_path
=
'/'
,
static_folder
=
gui_folder
)
@
blueprint
.
after_request
def
add_header
(
response
):
if
request
.
url
.
endswith
(
'index.html'
):
response
.
headers
[
'Cache-Control'
]
=
'no-cache, no-store, must-revalidate'
if
request
.
url
.
endswith
(
'.js'
):
response
.
headers
[
'Cache-Control'
]
=
'no-cache, must-revalidate'
return
response
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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