[LMP] Construct the URL for AN matching only if required.

For #1751.
[LMP] Cache media infos.