json.cache! ['json_screenshots'], expires_in: 1.hour do json.screenshots @s do |s| p = s.package json.extract! s, :version json.extract! p, :maintainer, :name, :section, :maintainer_email, :homepage, :description json.url package_url(p.name, protocol: 'https') json.small_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: "160x120")}" json.large_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: "800x600")}" end end