diff options
author | rinpatch <rinpatch@sdf.org> | 2019-11-06 16:41:19 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-12-13 21:19:55 +0300 |
commit | 66563f93fd73afb7caf35b1b803a9dcb6098dea4 (patch) | |
tree | 2763be04ee8312640d86aaee9391f6deb390d51e | |
parent | b7370ab51363839f7c1f291b693e17ee9089662c (diff) | |
download | pleroma-66563f93fd73afb7caf35b1b803a9dcb6098dea4.tar.gz |
Set better Cache-Control header for static content
Closes #1382
-rw-r--r-- | lib/pleroma/web/endpoint.ex | 2 | ||||
-rw-r--r-- | test/plugs/cache_control_test.exs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index e33e18be3..f0abc8eb8 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do plug(Pleroma.Plugs.HTTPSecurityPlug) plug(Pleroma.Plugs.UploadedMedia) - @static_cache_control "public, no-cache" + @static_cache_control "public max-age=86400 must-revalidate" # InstanceStatic needs to be before Plug.Static to be able to override shipped-static files # If you're adding new paths to `only:` you'll need to configure them in InstanceStatic as well diff --git a/test/plugs/cache_control_test.exs b/test/plugs/cache_control_test.exs index 45151b289..8f0af264e 100644 --- a/test/plugs/cache_control_test.exs +++ b/test/plugs/cache_control_test.exs @@ -9,7 +9,7 @@ defmodule Pleroma.Web.CacheControlTest do test "Verify Cache-Control header on static assets", %{conn: conn} do conn = get(conn, "/index.html") - assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"] + assert Conn.get_resp_header(conn, "cache-control") == ["public max-age=86400 must-revalidate"] end test "Verify Cache-Control header on the API", %{conn: conn} do |