Skip to content

Commit

Permalink
CatalogController: set per_page options and remove old max_per_page
Browse files Browse the repository at this point in the history
Bad bots are crawling the site at 100 per_page and driving down performance. Removing the 100 per_page option. We're also no longer clustering as many results as possible with each query, so we can drop the max_per_page option down to 50.

Addresses #556
  • Loading branch information
ewlarson committed Jan 8, 2024
1 parent 881310a commit d68879d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class CatalogController < ApplicationController
'bf' => ["if(exists(#{Settings.FIELDS.B1G_CHILD_RECORD}),0,100)^0.5"]
}

config.default_per_page = 10 # Works!
config.per_page = [10, 20, 50]
config.max_per_page = 50
config.default_per_page = 10

## Default parameters to send on single-document requests to Solr. These settings are the Blackligt defaults (see SolrHelper#solr_doc_params) or
## parameters included in the Blacklight-jetty document requestHandler.
Expand Down Expand Up @@ -346,7 +348,6 @@ class CatalogController < ApplicationController
# 'positron' http://cartodb.com/basemaps/
# 'darkMatter' http://cartodb.com/basemaps/
config.basemap_provider = 'esri'
config.max_per_page = 10000

# Configuration for autocomplete suggestor
config.autocomplete_enabled = true
Expand Down

0 comments on commit d68879d

Please sign in to comment.