diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-07-21 22:32:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-21 22:32:16 +0200 |
commit | c669bb42baa213dde27d831bb34f0ce14cfb29dc (patch) | |
tree | b609b21505c5f890b1200092de96b1bcc38b957e /app/controllers/api/v1/instances | |
parent | 59fd622adc18cb094146f7cda1025782d505404e (diff) |
Add (back) rails-level JSON caching (#11333)
Diffstat (limited to 'app/controllers/api/v1/instances')
-rw-r--r-- | app/controllers/api/v1/instances/activity_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/api/v1/instances/peers_controller.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/api/v1/instances/activity_controller.rb b/app/controllers/api/v1/instances/activity_controller.rb index 09edfe365..d0080c5c2 100644 --- a/app/controllers/api/v1/instances/activity_controller.rb +++ b/app/controllers/api/v1/instances/activity_controller.rb @@ -7,7 +7,8 @@ class Api::V1::Instances::ActivityController < Api::BaseController respond_to :json def show - render_cached_json('api:v1:instances:activity:show', expires_in: 1.day) { activity } + expires_in 1.day, public: true + render_with_cache json: :activity, expires_in: 1.day end private diff --git a/app/controllers/api/v1/instances/peers_controller.rb b/app/controllers/api/v1/instances/peers_controller.rb index a8891d126..450e6502f 100644 --- a/app/controllers/api/v1/instances/peers_controller.rb +++ b/app/controllers/api/v1/instances/peers_controller.rb @@ -7,7 +7,8 @@ class Api::V1::Instances::PeersController < Api::BaseController respond_to :json def index - render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { Account.remote.domains } + expires_in 1.day, public: true + render_with_cache(expires_in: 1.day) { Account.remote.domains } end private |