app/controllers/spotlight/home_pages_controller.rb
# Override show action to aggressively cache the response
# rubocop:disable Metrics/MethodLength
Override show action to aggressively cache the response
rubocop:disable Metrics/MethodLength
Override show action to aggressively cache the response rubocop : disable Metrics / MethodLength
def show
      if @page.display_sidebar?
        raw_response, raw_request = Rails.cache.fetch([current_exhibit, 'home', 'search_results']) do
          response, _document_list = search_service.search_results
          [response.to_h, response.request_params]
        end
        @response = Blacklight::Solr::Response.new(raw_response, raw_request, blacklight_config: blacklight_config)
        @document_list = []
      end
      if @page.nil? || !@page.published?
        render '/catalog/index'
      else
        render 'show'
      end
    end
def show if @page . display_sidebar? raw_response , raw_request = Rails . cache . fetch ( [ current_exhibit , 'home' , 'search_results' ] ) do response , _document_list = search_service . search_results [ response . to_h , response . request_params ] end @response = Blacklight :: Solr :: Response . new ( raw_response , raw_request , blacklight_config : blacklight_config ) @document_list = [ ] end if @page . nil? || ! @page . published? render '/catalog/index' else render 'show' end end
Override show action to aggressively cache the response
rubocop:disable Metrics/MethodLength
Override show action to aggressively cache the response rubocop : disable Metrics / MethodLength