Include cache headers to be returned for all responses over REST
To be used with https://gitlab.com/gitlab-org/cells/http-router
MR: Adding caching to HTTP-Router (http-router!112 - merged).
Screenshots
Before | After |
---|---|
Steps to validate
- Checkout the branch
- Start the Topology Service locally with
go run . serve
- Send a classify request
POST localhost:9096/v1/classify
- Verify that new Headers are included in the response
🎉
Steps to verify that caching works as expected!
- Update the
gitlab-topology-service/internal/services/classify/classify.go
file with something like
func (s *classifyServiceServer) classifyFirstCell(ctx context.Context) (*proto.ClassifyResponse, error) {
fmt.Println("Got request to classify FirstCell")
func (s *classifyServiceServer) classifySessionPrefix(ctx context.Context, req *proto.ClassifyRequest) (*proto.ClassifyResponse, error) {
fmt.Println("Got request to classify Session Prefix")
- Restart your GDK
- Observe the logs
gdk tail gitlab-topology-service
- Verify that requests are being cached
🎉
Edited by Bojan Marjanovic