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'),
'orientation' => 'portrait-primary',
'serviceworker' => [
'src' => 'sw.js',
'src' => 'sw.js?v='.ServiceWorkerController::Version(),
'scope' => '/',
'use_cache' => true,
],
@ -101,7 +101,7 @@ class ManifestController extends Controller
'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',
'type' => 'image/png',
],

View File

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