When Authorization header present in the inbound request, it's always a Cache Miss. My requirement is, I need ATS to treat the Authorization header like any other header (It should not cause cache miss and it should get forwarded to upstream service). How can I achieve this.
This may sound non-secure, but, I have a specific usecase for this. This cache is for internal use and it's access is controlled by other means.
I tried this
As per the official documentation
By default, Traffic Server does not cache objects with the following request headers:
Authorization
Cache-Control: no-store
Cache-Control: no-cache
To configure Traffic Server to ignore this request header,
Edit proxy.config.http.cache.ignore_client_no_cache in records.config.
CONFIG proxy.config.http.cache.ignore_client_no_cache INT 1 Run the command traffic_ctl config reload to apply the configuration changes.
but, no luck
Actually this https://docs.trafficserver.apache.org/en/latest/admin-guide/configuration/cache-basics.en.html#configuring-traffic-server-to-ignore-www-authenticate-headers did the trick for me.
The following instructions was applicable for
Authorizationheader as well, besidesWWW-AuthenticateHeader. They need to update the documentation.Configuring Traffic Server to Ignore WWW-Authenticate Headers
By default, Traffic Server does not cache objects that contain WWW-Authenticate response headers. The WWW-Authenticate header contains authentication parameters the client uses when preparing the authentication challenge response to an origin server.
When you configure Traffic Server to ignore origin server
WWW-Authenticateheaders, all objects withWWW-Authenticateheaders are stored in the cache for future requests. However, the default behavior of not caching objects withWWW-Authenticateheaders is appropriate in most cases. Only configure Traffic Server to ignore serverWWW-Authenticateheaders if you are knowledgeable about HTTP 1.1.To configure Traffic Server to ignore server
WWW-Authenticateheaders:Edit
proxy.config.http.cache.ignore_authenticationinrecords.config.Run the command
traffic_ctl config reloadto apply the configuration changes.