Hi! I'm currently researching headless WordPress and looking for a way to speed up the WordPress Rest API.
I stumbled upon your project in a Stackoverflow discussion and was wondering what you are planning to do with the rest-api.cache.php file. It seems like you're attempting to cache the JSON output of the REST API in static files?
I think this approach could be faster than caching the response in a transient or the object cache but it does not fix the fundamental problem which makes the WP Rest API slow which is that WordPress will always load the core, theme code and plugin code before serving your Rest API response (even if you only return the contents of a file).
I personally think that the only way to make the WP Rest API fast (+/- 50ms), is to add a caching proxy (for example an Express server which caches in Redis) between your front-end and WordPress which can be cleared from the WordPress side when content changes.
What are your thoughts on the above? Thanks in advance!
Peter