diff --git a/connect/webConn.go b/connect/webConn.go index 8891d881913109a785672e872dddb1abf3807ea0..c1f711579174054dc51975b8a5ffae6608e1af0a 100644 --- a/connect/webConn.go +++ b/connect/webConn.go @@ -2,15 +2,17 @@ package connect import ( "crypto/tls" - "git.xx.network/elixxir/grpc-web-go-client/grpcweb" - "github.com/pkg/errors" - jww "github.com/spf13/jwalterweatherman" - "google.golang.org/grpc" "net/http" "net/http/httptrace" "regexp" "strings" "time" + + "git.xx.network/elixxir/grpc-web-go-client/grpcweb" + "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" ) // WebConnParam struct holds parameters used @@ -102,11 +104,15 @@ func (wc *webConn) connectWebHelper() (err error) { backoffTime = 15000 } // ctx, cancel := newContext(time.Duration(backoffTime) * time.Millisecond) + md := &metadata.MD{} + md.Set("Cache-Control", "no-store, must-revalidate") + noCache := grpcweb.Header(md) dialOpts := []grpcweb.DialOption{ grpcweb.WithIdleConnTimeout(wc.h.params.WebParams.IdleConnTimeout), grpcweb.WithExpectContinueTimeout(wc.h.params.WebParams.ExpectContinueTimeout), grpcweb.WithTlsHandshakeTimeout(wc.h.params.WebParams.TlsHandshakeTimeout), + grpcweb.WithDefaultCallOptions(noCache), grpcweb.WithDefaultCallOptions(), // grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)), } dialOpts = append(dialOpts, securityDial...)