Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVO-1848: Cache requests to save time. #4244

Merged
merged 2 commits into from Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions Gemfile
Expand Up @@ -5,16 +5,18 @@ source "https://rubygems.org"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "6.1.7.6"

gem "actionpack-action_caching", "~> 1.2"
gem "actionpack-page_caching", "~> 1.2"
gem "alma", git: "https://github.com/tulibraries/alma_rb.git", branch: "main"
gem "autoprefixer-rails"
gem "awesome_print"
gem "base64", "0.1.1"
gem "bento_search"
gem "blacklight", "~> 7.33.0"
gem "blacklight_advanced_search", git: "https://github.com/projectblacklight/blacklight_advanced_search.git", ref: "v7.0.0"
gem "blacklight-marc"
gem "blacklight_range_limit", git: "https://github.com/tulibraries/blacklight_range_limit.git", branch: "bl-1431-bl-1358"
gem "blacklight-ris", git: "https://github.com/upenn-libraries/blacklight-ris.git"
gem "blacklight_advanced_search", git: "https://github.com/projectblacklight/blacklight_advanced_search.git", ref: "v7.0.0"
gem "blacklight_range_limit", git: "https://github.com/tulibraries/blacklight_range_limit.git", branch: "bl-1431-bl-1358"
gem "bootsnap", "1.18.3"
gem "bootstrap", "~> 4.6"
gem "browser"
Expand All @@ -27,7 +29,6 @@ gem "cob_index",
branch: "main"
gem "cob_web_index", git: "https://github.com/tulibraries/cob_web_index.git",
branch: "main"
gem "jwt"
gem "coffee-rails", "~> 5.0"
gem "devise"
gem "devise-guests", "~> 0.8"
Expand All @@ -40,14 +41,15 @@ gem "honeybadger", "5.5.0"
gem "httparty"
gem "jbuilder", "~> 2.11"
gem "jquery-rails"
gem "jwt"
gem "lc_solr_sortable", git: "https://github.com/tulibraries/lc_solr_sortable", branch: "main"
gem "net-smtp"
gem "nokogiri", "1.16.2"
gem "okcomputer"
gem "omniauth"
gem "omniauth-rails_csrf_protection"
gem "omniauth-shibboleth"
gem "omniauth-saml"
gem "net-smtp"
gem "nokogiri", "1.16.2"
gem "omniauth-shibboleth"
gem "popper_js"
gem "primo", git: "https://github.com/tulibraries/primo", branch: "main"
gem "puma", "6.4.2"
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Expand Up @@ -117,6 +117,10 @@ GEM
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actionpack-page_caching (1.2.4)
actionpack (>= 4.0.0)
actiontext (6.1.7.6)
actionpack (= 6.1.7.6)
activerecord (= 6.1.7.6)
Expand Down Expand Up @@ -622,6 +626,8 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
actionpack-action_caching (~> 1.2)
actionpack-page_caching (~> 1.2)
alma!
autoprefixer-rails
awesome_print
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/catalog_controller.rb
@@ -1,6 +1,9 @@
# frozen_string_literal: true

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

include FacetParamsDedupe
include BlacklightAdvancedSearch::Controller
include BlacklightRangeLimit::ControllerOverride
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/query_list_controller.rb
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class QueryListController < ApplicationController
caches_action :show, expires_in: 12.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