Hack to speed up loading the homepage
The modeling code is slow! I think in production it's being cached, and tbh I though I had development mode caching turned on over here, but it's quite evidently _not_ doing it if so, so. Okay! Skip for now.
This commit is contained in:
parent
684dcb53ba
commit
9fe44e3f91
1 changed files with 19 additions and 16 deletions
|
@ -50,6 +50,8 @@ class OutfitsController < ApplicationController
|
||||||
@colors = Color.funny.alphabetical
|
@colors = Color.funny.alphabetical
|
||||||
@species = Species.alphabetical
|
@species = Species.alphabetical
|
||||||
|
|
||||||
|
# HACK: Skip this in development, because it's slow!
|
||||||
|
unless Rails.env.development?
|
||||||
newest_items = Item.newest.
|
newest_items = Item.newest.
|
||||||
select(:id, :name, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc)
|
select(:id, :name, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc)
|
||||||
.limit(18)
|
.limit(18)
|
||||||
|
@ -68,6 +70,7 @@ class OutfitsController < ApplicationController
|
||||||
@newest_unmodeled_items_predicted_missing_species_by_color[item] = h
|
@newest_unmodeled_items_predicted_missing_species_by_color[item] = h
|
||||||
@newest_unmodeled_items_predicted_modeled_ratio[item] = item.predicted_modeled_ratio
|
@newest_unmodeled_items_predicted_modeled_ratio[item] = item.predicted_modeled_ratio
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@species_count = Species.count
|
@species_count = Species.count
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue