Chris Serrao
Chris Serrao

Reputation: 135

Read custom header from HttpRequest from browser set in earlier HttpResponse

I am adding multiple custom headers in my HttpResponse and on the next request from the browser for the page, I want to read those custom headers and determine if I need to send a 304 response to the browser.

I added the custom headers using Response.AddHeader but on the next request from the browser, the custom headers were not sent.

The browser did recieve the custom headers in the response stream but did not send them on the subsequent request.

I'm expecting the headers since I need to read them on the first request and not on post requests.

NOTE: I don't want to use cookies since I don't want to increase payload. I don't want to use sessions since I don't want to burden the server. My aim to decrease processing in the server as much as possible. As I've mentioned in my comment, I read about ETags and I'm hoping the technique that's used in ETags could be used for custom headers.

Upvotes: 0

Views: 960

Answers (1)

RossG
RossG

Reputation: 434

There are other ways of of passing information between requests. See this discussion.

You can also use session variables.

Upvotes: 1

Related Questions