Skip to content

Commit

Permalink
Bl-1848: Add action caching. (#4426)
Browse files Browse the repository at this point in the history
* BL-1848: Add back action caching.

This reverts commit 5950c8d.

* Disable tracking search session because it messes with action caching.

* Update action cache to one hour.
  • Loading branch information
dkinzer committed May 24, 2024
1 parent 1281921 commit 0dfd445
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class CatalogController < ApplicationController
caches_page :show
caches_action :index, expires_in: 1.hours, cache_path: Proc.new { |c| c.request.url }

include FacetParamsDedupe
include BlacklightAdvancedSearch::Controller
Expand All @@ -12,6 +13,7 @@ class CatalogController < ApplicationController
include ServerErrors
include LCClassifications

skip_forgery_protection only: [:index]
before_action :authenticate_purchase_order!, only: [ :purchase_order, :purchase_order_action ]
before_action :set_thread_request
before_action only: :index do
Expand Down Expand Up @@ -41,7 +43,7 @@ def self.libwizard_tutorial?
config.advanced_search[:form_solr_parameters]["f.language_facet.facet.sort"] ||= "index"
config.advanced_search[:fields_row_count] = 3

config.track_search_session = true
config.track_search_session = false
config.raw_endpoint.enabled = true

## Class for sending and receiving requests from a search index
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/query_list_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class QueryListController < ApplicationController
caches_action :show, expires_in: 12.hours, cache_path: Proc.new { |c| c.request.url }
caches_action :show, expires_in: 1.hours, cache_path: Proc.new { |c| c.request.url }

def show
search_service = search_service_class.new(config: blacklight_config, user_params: params)
Expand Down

0 comments on commit 0dfd445

Please sign in to comment.