Copy link to clipboard
Copied
Very often clients want to integrate external services with BC.
At least they often want to GET data from external sources and display it on BC pages.
On my practice, that were APIs of Google CSE, domain lookup databases, custom databases.
We make it with Javascript, but obviously authentication keys are exposed to public.
So it would be great to have an ability to call external services via http from server-side of BC.
Something like {module_data resource="external" url="someurl" params="\{somejson\}" key="someapikey"}.
This way we could keep keys safe and improve load speed of such pages.
Server-side POST requests will be a great option, too, as clients sometimes want to use external CRMs, email services and other.
Copy link to clipboard
Copied
This is a very good idea.
Not sure this will get through into production as it will have a drastic effect on BCs caching. A philosophical example is exactly in line with why Liquid, (BC or Shopify) don't accept the random variable in Liquid due to the nature of not being able to cache the outputted HTML results.
If liquid has to keep reading a 3rd party server, waiting for a response, wait for data to come back (XML, JSON), before commencing processing for the rest of the page, this would prevent and inhibit any caching and speed improvement BC has tried implementing the last 2-3 years.
Another example is why {module_json} only reads from a local source and not an external 3rd party URL. Caching and speeds issues.
But I love the idea!