about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2018-09-24 23:15:49 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-09-24 16:15:49 +0200
commit86f138ed169e41142862e86c3e3d48a0d48f9c0e (patch)
treecb98153858fdd9049ec668008f7e69ff3c873b76 /app/controllers/api
parent8b61683f9ea3ebbfc4658fb3effc82f0a9eb7d47 (diff)
Cache instance info (#8765)
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/instances_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/api/v1/instances_controller.rb b/app/controllers/api/v1/instances_controller.rb
index 1c6971c18..5686e8d7c 100644
--- a/app/controllers/api/v1/instances_controller.rb
+++ b/app/controllers/api/v1/instances_controller.rb
@@ -4,6 +4,8 @@ class Api::V1::InstancesController < Api::BaseController
   respond_to :json
 
   def show
-    render json: {}, serializer: REST::InstanceSerializer
+    render_cached_json('api:v1:instances', expires_in: 5.minutes) do
+      ActiveModelSerializers::SerializableResource.new({}, serializer: REST::InstanceSerializer)
+    end
   end
 end