From eb1a14279eb92062866d952144807d313ceba7cf Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Wed, 13 Mar 2024 22:03:38 +0800 Subject: [PATCH] fix: add cache to address live cells api Signed-off-by: Miles Zhang --- app/controllers/api/v1/address_live_cells_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/api/v1/address_live_cells_controller.rb b/app/controllers/api/v1/address_live_cells_controller.rb index 3e379309df..b4832faf1a 100644 --- a/app/controllers/api/v1/address_live_cells_controller.rb +++ b/app/controllers/api/v1/address_live_cells_controller.rb @@ -4,6 +4,8 @@ class AddressLiveCellsController < ApplicationController before_action :validate_pagination_params, :pagination_params def show + expires_in 1.minutes, public: true, must_revalidate: true, stale_while_revalidate: 10.seconds + address = Address.find_address!(params[:id]) raise Api::V1::Exceptions::AddressNotFoundError if address.is_a?(NullAddress)