Adding caching to HTTP-Router
Why
As per #13 (closed), 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-router
branch in your local GDK - Update the
wrangler.toml
insidegitlab-http-router
repo 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.go
file inside the GDK'sgitlab-topology-service
repo to include some kind of logging, e.g. (fmt.Println("Got request to classify FirstCell")
inside theclassifyFirstCell()
function. - Run
gdk tail gitlab-topology-service
in your terminal - Verify that request are successfully cached!
🎉
Edited by Bojan Marjanovic