IMPR: Versioning

This commit is contained in:
Tony Air 2020-04-02 10:10:36 +07:00
parent db8bb88bbc
commit e6eff33908
2 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class ManifestController extends Controller
'theme_color' => $cfg->get('background'), 'theme_color' => $cfg->get('background'),
'orientation' => 'portrait-primary', 'orientation' => 'portrait-primary',
'serviceworker' => [ 'serviceworker' => [
'src' => 'sw.js', 'src' => 'sw.js?v='.ServiceWorkerController::Version(),
'scope' => '/', 'scope' => '/',
'use_cache' => true, 'use_cache' => true,
], ],
@ -101,7 +101,7 @@ class ManifestController extends Controller
'type' => 'image/png', 'type' => 'image/png',
], ],
[ [
'src' => self::join_links($icons_path, 'android-chrome-384x384.png'), 'src' => self::join_links($icons_path, 'android-chrome-512x512.png'),
'sizes' => '512x512', 'sizes' => '512x512',
'type' => 'image/png', 'type' => 'image/png',
], ],

View File

@ -78,8 +78,8 @@ class ServiceWorkerController extends Controller {
return $this->config()->get('debug_mode'); return $this->config()->get('debug_mode');
} }
public function Version() { public static function Version() {
return $this->config()->get('version').filemtime(self::getScriptPath()); return self::config()->get('version').filemtime(self::getScriptPath());
} }
/** /**