Revert "Set better Cache-Control header for static content"
authorrinpatch <rinpatch@sdf.org>
Wed, 11 Mar 2020 14:58:25 +0000 (17:58 +0300)
committerrinpatch <rinpatch@sdf.org>
Sun, 15 Mar 2020 13:59:39 +0000 (16:59 +0300)
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

lib/pleroma/web/endpoint.ex
test/plugs/cache_control_test.exs

index 118c3ac6fd1f482d876aa086c324da1288186ced..72cb3ee279536954b9aed4cb8b10df93817fb6a9 100644 (file)
@@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do
   plug(Pleroma.Plugs.HTTPSecurityPlug)
   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
   # If you're adding new paths to `only:` you'll need to configure them in InstanceStatic as well
index 005912ffbfa9e7d2ca88c31e1360ff3ef45c8ac0..6b567e81d70319a1e7e62d01ba20c2649508c18a 100644 (file)
@@ -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 max-age=86400 must-revalidate"]
+    assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"]
   end
 
   test "Verify Cache-Control header on the API", %{conn: conn} do