Currently we are restricting the request to use curl https://github.com/matomo-org/matomo/pull/19957/files#diff-105cf795eee08d8e19b4daf399977e29fbbf8b3d5d2b6995e06d0909e0b68785R116, whereas we can just use
sendHttpRequest(). Let's switch it to use that unless there is reason not to?
Also can we make sure to cache the result for say 4+ weeks or forever or something? Then we don't try to request the data every time which would make these pages and widgets etc quite slow. Ideally, we would even mostly update the cached result only in the background (or store it forever).
@mattab I have added this directly to the current patch milestone as an extension of the previous work which was also scheduled for this release. I recommend we include it but let me know if it's something you would prefer to delay 👍🏽
@justinvelluppillai I think this is because
sendHttpRequestBy contains a param defines,
sendHttpRequest does not have the feature, if I am correct.
If needed we can still use that function but instead of specifying curl we can use
Http::getTransportMethod() - perhaps this would need investigation.
Yes. Simply using
Http::getTransportMethod() should be they way to go here...