• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Server-side HTTP request from BC to remote server

Contributor ,
Feb 16, 2017 Feb 16, 2017

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.

TOPICS
Developer

Views

216

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 19, 2017 Feb 19, 2017

Copy link to clipboard

Copied

LATEST

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines