forked from AkkomaGang/akkoma
Cache plug module name
This commit is contained in:
parent
c6baa811d6
commit
66e0b0065b
3 changed files with 5 additions and 5 deletions
|
@ -46,7 +46,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|
||||||
)
|
)
|
||||||
|
|
||||||
plug(
|
plug(
|
||||||
Pleroma.Plugs.Cache,
|
Pleroma.Web.Plugs.Cache,
|
||||||
[query_params: false, tracking_fun: &__MODULE__.track_object_fetch/2]
|
[query_params: false, tracking_fun: &__MODULE__.track_object_fetch/2]
|
||||||
when action in [:activity, :object]
|
when action in [:activity, :object]
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Plugs.Cache do
|
defmodule Pleroma.Web.Plugs.Cache do
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
Caches successful GET responses.
|
Caches successful GET responses.
|
||||||
|
|
||||||
To enable the cache add the plug to a router pipeline or controller:
|
To enable the cache add the plug to a router pipeline or controller:
|
||||||
|
|
||||||
plug(Pleroma.Plugs.Cache)
|
plug(Pleroma.Web.Plugs.Cache)
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
To configure the plug you need to pass settings as the second argument to the `plug/2` macro:
|
To configure the plug you need to pass settings as the second argument to the `plug/2` macro:
|
||||||
|
|
||||||
plug(Pleroma.Plugs.Cache, [ttl: nil, query_params: true])
|
plug(Pleroma.Web.Plugs.Cache, [ttl: nil, query_params: true])
|
||||||
|
|
||||||
Available options:
|
Available options:
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ defmodule Pleroma.Web.Plugs.CacheTest do
|
||||||
use ExUnit.Case, async: true
|
use ExUnit.Case, async: true
|
||||||
use Plug.Test
|
use Plug.Test
|
||||||
|
|
||||||
alias Pleroma.Plugs.Cache
|
alias Pleroma.Web.Plugs.Cache
|
||||||
|
|
||||||
@miss_resp {200,
|
@miss_resp {200,
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in a new issue