[RFC] [gatsby-source-drupal]: fetching individual entities instead of lists for higher cache hit rate #32040
Unanswered
KyleAMathews
asked this question in
RFC
Replies: 1 comment 2 replies
-
We'd need to see comparable numbers for the cost of making 50x more requests. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The source plugin currently fetches entities in pages of 50. Which is very fast when the requests are cached. But Drupal's cache eviction policy unfortunately evicts all API pages whenever any entity is modified. Which means that most sources are hitting Drupal. Which is dramatically slower — 10-20x slower.
@Auspicus, @rcaracaus, and I have been discussing that we change the source plugin to fetch individual entities. This seems slower as it'd mean ~50x more API requests. But given that Drupal only evicts the entity's cache when the actual entity changes, the source plugin's cache rate should go from ~10% to perhaps 90%+ So could end up being quite a bit faster on average.
We'd need a new endpoint in the Gatsby module which gives gatsby-source-drupal a list of all entities that need fetched.
A downside to this approach (perhaps can be worked around) is that JSON:API's filters wouldn't work.
Beta Was this translation helpful? Give feedback.
All reactions