diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index b58d577e..0a2544bf 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -171,7 +171,13 @@ class ItemsController < ApplicationController appearance_params[:color_id], appearance_params[:species_id]) end - target.appearances_for(@items.map(&:id), swf_asset_includes: [:zone]) + target.appearances_for(@items.map(&:id), swf_asset_includes: [:zone]). + tap do |appearances| + # Preload the manifests for these SWF assets concurrently, rather than + # loading them in sequence when we generate the JSON. + swf_assets = appearances.values.map(&:swf_assets).flatten + SwfAsset.preload_manifests(swf_assets) + end end def search_error(e)