mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Merge pull request #233 from YunoHost/dont_use_version_for_cache_control
Don't use version for cache control
This commit is contained in:
commit
a5e4b8d6d6
3 changed files with 8 additions and 6 deletions
6
debian/postinst
vendored
6
debian/postinst
vendored
|
@ -10,6 +10,12 @@ do_configure() {
|
|||
|
||||
# Set document root permissions
|
||||
chown -R root:root /usr/share/yunohost/admin
|
||||
|
||||
# Replace RANDOMID with a random hash to invalidate
|
||||
# old cache ... we generate this locally on each machine
|
||||
# to avoid leaking stuff like the version
|
||||
RANDOMID=$(openssl rand -hex 4)
|
||||
sed -i "s/RANDOMID/$RANDOMID/g" /usr/share/yunohost/admin/index.html
|
||||
}
|
||||
|
||||
# summary of how this script can be called:
|
||||
|
|
4
debian/rules
vendored
4
debian/rules
vendored
|
@ -15,10 +15,6 @@ TMPDIR = $$(pwd)/debian/yunohost-admin
|
|||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
# Replace VERSION with current package version to prevent web browser
|
||||
# to serve old css/js files
|
||||
sed -i 's/VERSION/$(DEBVERS)/g' src/index.html
|
||||
|
||||
# Run npm/bower/gulp
|
||||
cd src ; npm --progress false --loglevel warn --color false install
|
||||
cd src ; node_modules/gulp/bin/gulp.js build
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height" />
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" media="screen" href="dist/css/style.min.css?version=VERSION">
|
||||
<link rel="stylesheet" media="screen" href="dist/css/style.min.css?version=RANDOMID">
|
||||
<link rel="shortcut icon" href="dist/img/ynhadmin_icon.png">
|
||||
<script type="text/javascript" src="dist/js/script.min.js?version=VERSION"></script>
|
||||
<script type="text/javascript" src="dist/js/script.min.js?version=RANDOMID"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
Loading…
Reference in a new issue