diff options
| author | 2013-11-09 01:50:42 +0100 | |
|---|---|---|
| committer | 2013-11-09 01:50:42 +0100 | |
| commit | a5bc7d20d4150c30dd70b33120ee062ede1f7d96 (patch) | |
| tree | 107196db9eb6c1775b89d393bcf8800ffb1b4b4d /app/App_FrontController.php | |
| parent | 1de8218182a7126d4b44c4a5f35d1eaf7ef4bb71 (diff) | |
Évite les problèmes de cache des resources CSS et JS statiques
Ajoute une date automatique aux CSS et JS. Ne devrait pas entraver la
bonne mise en cache grâce aux entêtes HTTP dont `Cache-Control: public`
Diffstat (limited to 'app/App_FrontController.php')
| -rw-r--r-- | app/App_FrontController.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 02b379bca..82499ada3 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -54,18 +54,18 @@ class App_FrontController extends FrontController { $theme = RSSThemes::get_infos($this->conf->theme()); if ($theme) { foreach($theme["files"] as $file) { - View::appendStyle (Url::display ('/themes/' . $theme['path'] . '/' . $file)); + View::appendStyle (Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file))); } } - View::appendStyle (Url::display ('/themes/printer/style.css'), 'print'); + View::appendStyle (Url::display ('/themes/printer/style.css?' . filemtime(PUBLIC_PATH . '/themes/printer/style.css')), 'print'); if (login_is_conf ($this->conf)) { View::appendScript ('https://login.persona.org/include.js'); } - View::appendScript (Url::display ('/scripts/jquery.min.js')); + View::appendScript (Url::display ('/scripts/jquery.min.js?' . filemtime(PUBLIC_PATH . '/scripts/jquery.min.js'))); if ($this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader')) { - View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js')); + View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js?' . filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js'))); } - View::appendScript (Url::display ('/scripts/main.js')); + View::appendScript (Url::display ('/scripts/main.js?' . filemtime(PUBLIC_PATH . '/scripts/main.js'))); } private function loadNotifications () { |
