Subject: | $AUTHOR->releases() ignores UA passed to MetaCPAN::Client->new() |
https://metacpan.org/source/XSAWYERX/MetaCPAN-Client-1.003000/lib/MetaCPAN/Client/Author.pm#L32
This means:
my $client = MetaCPAN::Client->new( ua => $cachingua );
my $author = $client->author("KENTNL");
$author->releases();
Completely ignores the caching, so you get a cached response for ->author(), but not a cached response from ->releases()
As evidenced by testing both with, and without a cache, for me, both take a full 9 seconds.
However, then your still having it not cache due to using Search::ElasticSearch, which has its own UA.
After a bit of source diving I discoved you can do:
my $es = Search::Elasticsearch->new(
nodes => $self->domain,
cxn_pool => 'Static::NoPing',
send_get_body_as => 'POST',
handle => $self->ua,
);
And upon doing this, it becomes much more obvious that it's processing requests through the caching UA.
Though it doesn't seem to give much performance benefit to cache for some reason.