Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
reduce data transferred for /recent
  • Loading branch information
monken committed Jul 19, 2013
1 parent d310c82 commit 733f309
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Web/Controller/Recent.pm
Expand Up @@ -6,7 +6,7 @@ use base 'MetaCPAN::Web::Controller';
sub index : Path {
my ( $self, $c ) = @_;
my ($data) = $c->model('API::Release')->recent( $c->req->page, $c->req->params->{f} || 'l' )->recv;
my $latest = [ map { $_->{_source} } @{ $data->{hits}->{hits} } ];
my $latest = [ map { $_->{fields} } @{ $data->{hits}->{hits} } ];
$c->res->last_modified($latest->[0]->{date}) if(@$latest);
$c->stash(
{ recent => $latest,
Expand Down
1 change: 1 addition & 0 deletions lib/MetaCPAN/Web/Model/API/Release.pm
Expand Up @@ -110,6 +110,7 @@ sub recent {
{ size => 100,
from => ( $page - 1 ) * 100,
query => $query,
fields => [qw(name author status abstract date distribution)],
sort => [ { 'date' => { order => "desc" } } ]
}
);
Expand Down

0 comments on commit 733f309

Please sign in to comment.