From a2c65ad26c942b63f9d23e9017d8f3a3fb4bbba0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 18 Mar 2015 13:58:08 +0100 Subject: [PATCH] Small changes regarding static resources caching --- conf/httpd_alias.conf | 3 --- conf/httpd_vhost.conf | 3 --- public/js/vroom.js | 18 ++++-------------- vroom.pl | 2 -- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/conf/httpd_alias.conf b/conf/httpd_alias.conf index ee793a5..3c11d97 100644 --- a/conf/httpd_alias.conf +++ b/conf/httpd_alias.conf @@ -39,9 +39,6 @@ ProxyPassReverse /vroom/ http://127.0.0.1:8090/ ExpiresActive on ExpiresDefault "access plus 1 month" - ExpiresByType application/json "access plus 0 seconds" - ExpiresByType application/xml "access plus 0 seconds" - ExpiresByType text/xml "access plus 0 seconds" ExpiresByType text/html "access plus 0 seconds" # You should customize this part to access the admin interface diff --git a/conf/httpd_vhost.conf b/conf/httpd_vhost.conf index d3b9d2d..d928792 100644 --- a/conf/httpd_vhost.conf +++ b/conf/httpd_vhost.conf @@ -45,9 +45,6 @@ ExpiresActive on ExpiresDefault "access plus 1 month" - ExpiresByType application/json "access plus 0 seconds" - ExpiresByType application/xml "access plus 0 seconds" - ExpiresByType text/xml "access plus 0 seconds" ExpiresByType text/html "access plus 0 seconds" # You should customize this part to access the admin interface diff --git a/public/js/vroom.js b/public/js/vroom.js index 7952153..2242c48 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -36,24 +36,14 @@ var webrtc = undefined; $('#lnk_' + page).addClass('active'); // Localize the strings we need -$.ajax({ - url: rootUrl + 'localize/' + currentLang, - type: 'GET', - dataType: 'json', - success: function(data) { - locale = data; - } +$.getJSON(rootUrl + 'localize/' + currentLang, function(data){ + locale = data; }); // If current locale isn't EN, retrieve EN locale as a fallback if (currentLang !== 'en'){ - $.ajax({ - url: rootUrl + 'localize/en', - type: 'GET', - dataType: 'json', - success: function(data) { - def_locale = data; - } + $.getJSON(rootUrl + 'localize/en' , function(data){ + def_locale = data; }); } diff --git a/vroom.pl b/vroom.pl index 0942bca..2d6ba94 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1298,8 +1298,6 @@ get '/localize/:lang' => { lang => 'en' } => sub { $strings->{$string} = $self->l($string); } $self->languages($l); - # Tell the client to cache it - $self->res->headers->cache_control('private,max-age=3600'); return $self->render(json => $strings); };