Reading file from API v4 never returns 304 status code

I am using the gitlab API to read a file in a repo. That works fine.

However the API docs say that if the file hasn’t changed since the last request a 304 status will be returned. I have two questions here.

  1. How is the API tracking the ‘since last request’ part? Is it based on the access token?
  2. I am never receiving a 304 status code when the file has not changed? Is there some addition setting I need to change?

My concern is that if we start getting the 304 response (with and empty body) the down stream logic would need to handle that.

Thanks!