Skip to content

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
image image

Steps to validate

  1. Checkout the branch
  2. Start the Topology Service locally with go run . serve
  3. Send a classify request POST localhost:9096/v1/classify
  4. Verify that new Headers are included in the response 🎉

Steps to verify that caching works as expected!

  1. 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")
  1. Restart your GDK
  2. Observe the logs gdk tail gitlab-topology-service
  3. Verify that requests are being cached 🎉
Edited by Bojan Marjanovic

Merge request reports

Loading