[gatsby-source-drupal] provide proxyUrl in addition to baseUrl to allow using CDN, API gateway, etc. #36811
Replies: 3 comments
-
NB This would also be a solution for issue #36774 where we need the request URL to contain a path. |
Beta Was this translation helpful? Give feedback.
-
Opened a pull request for this, please review In my particular situation - fetch directly from a Drupal server (32 GB RAM, 8 vCPUs) vs fetch from a CDN (CloudFront) improves the "Fetch all data from Drupal" build phase by a factor of 10! |
Beta Was this translation helpful? Give feedback.
-
The results are in fact much better; the acceleration thanks to the use of CDN is about 95x (cf https://www.vacilando.org/article/using-cdn-accelerate-drupal-api-sourcing-gatsbyjs). |
Beta Was this translation helpful? Give feedback.
-
Plugin gatsby-source-drupal accepts baseUrl and when fetching data from Drupal goes first to baseUrl/apiBase (e.g. www.example.com/jsonapi) to get the list of resources.
The list of resources contains info like this:
For performance reasons it's often desirable to request these resources via a CDN or an API gateway.
This is currently impossible, because even if we put use the CDN url as baseUrl, the data will be - based on the list in baseUrl/apiBase - fetched from the baseUrl.
So here's a small feature improvement idea:
To me this seems like a very small / simple improvement. I am happy to contribute to the development / testing with some guidance of the gatsby-source-drupal developers.
Beta Was this translation helpful? Give feedback.
All reactions