25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

* src/web/ejabberd_web_admin.erl: Include Last-Modified HTTP

header in responses to allow caching (EJAB-546)

SVN Revision: 1292
This commit is contained in:
Badlop 2008-04-12 08:09:05 +00:00
parent cf8c08c980
commit 7c64509c46
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2008-04-12 Badlop <badlop@process-one.net>
* src/web/ejabberd_web_admin.erl: Include Last-Modified HTTP
header in responses to allow caching (EJAB-546)
2008-04-11 Badlop <badlop@process-one.net> 2008-04-11 Badlop <badlop@process-one.net>
* src/Makefile.in: Improved indentation of GCC call * src/Makefile.in: Improved indentation of GCC call

View File

@ -635,16 +635,16 @@ process_admin(Host,
], Host, Lang); ], Host, Lang);
process_admin(Host, #request{path = ["style.css"]}) -> 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"]}) -> 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"]}) -> 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"]}) -> 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, process_admin(Host,
#request{path = ["acls-raw"], #request{path = ["acls-raw"],
@ -2272,3 +2272,7 @@ url_func({users_queue, Prefix, User, _Server}) ->
url_func({user, Prefix, User, _Server}) -> url_func({user, Prefix, User, _Server}) ->
Prefix ++ "user/" ++ User ++ "/". Prefix ++ "user/" ++ User ++ "/".
last_modified() ->
{"Last-Modified", "Mon, 25 Feb 2008 13:23:30 GMT"}.
cache_control_public() ->
{"Cache-Control", "public"}.