Adding caching to HTTP-Router
Why
As per #13, we should introduce some caching logic to our HTTP-Router.
What
Following the Cloudflare Docs on caching, we're introducing a new layer that will cache all requests going to the Topology Service.
Currently, we're caching all request per their type and value.
Steps to reproduce
- Checkout the
13-consider-adding-caching-to-http-routerbranch in your local GDK - Update the
wrangler.tomlinsidegitlab-http-routerrepo to includeGITLAB_TOPOLOGY_SERVICE_URL = "http://localhost:9096/" - Enable the Topology Service in your GDK
gdk config set gitlab_topology_service.enabled true - Run
gdk reconfigure - Update the
classify.gofile inside the GDK'sgitlab-topology-servicerepo to include some kind of logging, e.g. (fmt.Println("Got request to classify FirstCell")inside theclassifyFirstCell()function. - Run
gdk tail gitlab-topology-servicein your terminal - Verify that request are successfully cached!
🎉
Edited by Bojan Marjanovic