1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Plugs.CacheControlTest do
6 use Pleroma.Web.ConnCase, async: true
9 test "Verify Cache-Control header on static assets", %{conn: conn} do
10 conn = get(conn, "/index.html")
12 assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"]
15 test "Verify Cache-Control header on the API", %{conn: conn} do
16 conn = get(conn, "/api/v1/instance")
18 assert Conn.get_resp_header(conn, "cache-control") == ["max-age=0, private, must-revalidate"]