Revert "Set better Cache-Control header for static content"
On furher investigation it seems like all that did was cause unintuitive behavior. The emoji request flood that was the reason for introducing it isn't really that big of a deal either, since Plug.Static only needs to read file modification time and size to determine the ETag. Closes #1613
This commit is contained in:
parent
9dbf493b65
commit
c3b9fbd3a7
|
@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do
|
||||||
plug(Pleroma.Plugs.HTTPSecurityPlug)
|
plug(Pleroma.Plugs.HTTPSecurityPlug)
|
||||||
plug(Pleroma.Plugs.UploadedMedia)
|
plug(Pleroma.Plugs.UploadedMedia)
|
||||||
|
|
||||||
@static_cache_control "public max-age=86400 must-revalidate"
|
@static_cache_control "public, no-cache"
|
||||||
|
|
||||||
# InstanceStatic needs to be before Plug.Static to be able to override shipped-static files
|
# 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
|
# If you're adding new paths to `only:` you'll need to configure them in InstanceStatic as well
|
||||||
|
|
|
@ -9,7 +9,7 @@ defmodule Pleroma.Web.CacheControlTest do
|
||||||
test "Verify Cache-Control header on static assets", %{conn: conn} do
|
test "Verify Cache-Control header on static assets", %{conn: conn} do
|
||||||
conn = get(conn, "/index.html")
|
conn = get(conn, "/index.html")
|
||||||
|
|
||||||
assert Conn.get_resp_header(conn, "cache-control") == ["public max-age=86400 must-revalidate"]
|
assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"]
|
||||||
end
|
end
|
||||||
|
|
||||||
test "Verify Cache-Control header on the API", %{conn: conn} do
|
test "Verify Cache-Control header on the API", %{conn: conn} do
|
||||||
|
|
Loading…
Reference in New Issue