- 🇮🇪Ireland lostcarpark
Sorry this issue has been left hanging a long time. It dates from before I took over maintainership of the module.
This is an interesting topic, and worthy of further investigation. However, I wonder is static variable caching the best approach to take?
The patch needs to be moved into a merge request.
Static variables cannot persist across PHP instances (i.e. a single HTTP request), so the caching is only effective where the same piece of data is used multiple times within the same instance of PHP. I wonder would it be more effective to use one of Drupal caching mechanisms to speed up access across all PHP instances, and rely on Drupal Cache invalidation to discard stale cache values.
I know there are several mechanisms for keeping a persistant instance of PHP running. I have a slight concern that there might be cases where static variables could be persistent across multiple requests. If that were the case, there would be no mechanism for invalidating the cached values, so old data would be displayed. I'd want to confident there aren't any such mechanisms in use for Drupal hosting before merging this.
Finally, it would be nice to have test coverage for this. I'm not sure how you would test in this case, however.
Setting back to "Needs work" for now.