views:

119

answers:

2

Hello everyone,

I am using http meta refresh to reflesh current page to keep session live. I am using VSTS 2008 + C# + .Net 3.5 and developing ASP.Net application.

My question is, is it possible to send from client (browser) side If-Not-Modified-Since request header to server side and check if at server side responses 304 Not-Modified header to client? (I want to use this to optmize bandwidth and overhead at server.)

If yes, could anyone recommend me some sample code at client side and at server side how to implement this?

thanks in advance, George

+1  A: 

I'm not super familiar with ASP.NET, but in general, for something like this, consider using ETags.

thedz
Thanks, two questions. 1. Does all major browsers support Etag? 2. For the logics -- "When a new HTTP response contains the same ETag as an older HTTP response, the contents are considered to be the same without further downloading.", do we need to implement it by ourselves or browser has built-in implementation?
George2
+1  A: 

This could potentially be addressed with the HtmlMeta class that was added in .NET 2.0. It allows programmatic access to the meta keywords. You can check it out here.

Thanks, the link is very helpful. Actually my question is not how to use Meta Control, but how to send from client (browser) side If-Not-Modified-Since request header to server side and check if at server side responses 304 Not-Modified header to client? Any ideas?
George2