From 7c64509c4608b91695030d1a1619cf42e81f61b3 Mon Sep 17 00:00:00 2001 From: Badlop Date: Sat, 12 Apr 2008 08:09:05 +0000 Subject: [PATCH] * src/web/ejabberd_web_admin.erl: Include Last-Modified HTTP header in responses to allow caching (EJAB-546) SVN Revision: 1292 --- ChangeLog | 5 +++++ src/web/ejabberd_web_admin.erl | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b02212b95..7dc1aab06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-12 Badlop + + * src/web/ejabberd_web_admin.erl: Include Last-Modified HTTP + header in responses to allow caching (EJAB-546) + 2008-04-11 Badlop * src/Makefile.in: Improved indentation of GCC call diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 25ea9d237..abc1ac871 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -635,16 +635,16 @@ process_admin(Host, ], Host, Lang); process_admin(Host, #request{path = ["style.css"]}) -> - {200, [{"Content-Type", "text/css"}], css(Host)}; + {200, [{"Content-Type", "text/css"}, last_modified(), cache_control_public()], css(Host)}; process_admin(_Host, #request{path = ["favicon.ico"]}) -> - {200, [{"Content-Type", "image/x-icon"}], favicon()}; + {200, [{"Content-Type", "image/x-icon"}, last_modified(), cache_control_public()], favicon()}; process_admin(_Host, #request{path = ["logo.png"]}) -> - {200, [{"Content-Type", "image/png"}], logo()}; + {200, [{"Content-Type", "image/png"}, last_modified(), cache_control_public()], logo()}; process_admin(_Host, #request{path = ["logo-fill.png"]}) -> - {200, [{"Content-Type", "image/png"}], logo_fill()}; + {200, [{"Content-Type", "image/png"}, last_modified(), cache_control_public()], logo_fill()}; process_admin(Host, #request{path = ["acls-raw"], @@ -2272,3 +2272,7 @@ url_func({users_queue, Prefix, User, _Server}) -> url_func({user, Prefix, User, _Server}) -> Prefix ++ "user/" ++ User ++ "/". +last_modified() -> + {"Last-Modified", "Mon, 25 Feb 2008 13:23:30 GMT"}. +cache_control_public() -> + {"Cache-Control", "public"}.