Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ETag and Last-Modified HTTP implementation?  RSS feed

 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know, in simple terms what a client sends in it's HTTP request when making use of the ETag header, then what the server does with that value? Is it something like this?

1. Client sends first request for file
2. Server gets "checksum" for that file, sends it in the ETag field followed by the file
3. Client caches that ETag
4. Client request file at a later date and sends the ETag in the request
5. Server sees that the ETag matches so doesnt send entire file back again

The Last-modified header is simple as far as I know:

1. Client requests file for first time
2. Server sends Last-modified time with the response
3. Client caches the last-modified time
4. Client request file at a later date but sends a If-Modified-Since header
5. Server compares dates and only sends full file if that date is newer.

The main thing that I'm not clear about is what header the client sends when it wants to compare with an ETag.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may find this article of interest.
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aaaahhh I get it. I was trying to send ETag back. I'd seen If-None-Match but never actually linked that with the ETag for some reason. Doh!

Thanks ever so much, that's really useful!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!