Questions tagged [if-modified-since]

If-Modified-Since is a HTTP conditional request header, where last modification date is the condition.

The request header If-Modified-Since is used to conditionally request HTTP resources which have not changed since the previous request.

If the original response was cacheable and contained a valid Last-Modified response header (a RFC 822 datetime), the user agent (browser) may send this datetime with the next request (this is one of the "cache revalidation" mechanisms of HTTP); if the resource was not modified, the server should respond with a 304 Not Modified instead of sending the content body - which is then served from client's cache. This header is only applicable to GET requests.

If-Modified-Since is to Last-Modified as If-None-Match is to ETag.

See RFC 2616 for the official definition.

88 questions
50
votes
1 answer

how does a etag work in expressjs

Expressjs automatically send etags. I would like to know how the etag is generated..is it based on the content that is generated dynamically by the get routine. or is there way I can mainpulate it, by not even going through the process of generating…
coool
  • 7,725
  • 12
  • 50
  • 77
46
votes
5 answers

Why am I getting "(304) Not Modified" error on some links when using HttpWebRequest?

Any ideas why on some links that I try to access using HttpWebRequest I am getting "The remote server returned an error: (304) Not Modified." in the code? The code I'm using is from Jeff's post here (the page seems to have disappeared, see an…
Greg
  • 31,898
  • 75
  • 232
  • 424
19
votes
7 answers

Chrome - why is it sending if-modified-since requests?

I have a page with lots of small images (icons). When used with chrome, each time the page is reloaded, chrome requests each icon from the server with if-modified-since header. All icons are served with expires and max-age headers. Firefox loads…
user473428
  • 191
  • 1
  • 1
  • 3
18
votes
1 answer

(Weak) ETags and Last-Modified

As far as I understand the specs, the ETag, which was introduced in RFC 2616 (HTTP/1.1) is a successor (of sorts) for the Last-Modified-Header, which is proposet to give the software-architect more controll over the cache-revalidating process. If…
Kai Moritz
  • 591
  • 2
  • 6
  • 16
14
votes
2 answers

Understand If-Modified-Since HTTP Header

I am looking at a Caching library that is trying to use the If-Modified-Since header of a request object. The problem is this header never gets set, it is always blank which makes sense to me seeing how it is a REQUEST. How can you force a request…
Mike
  • 11,085
  • 15
  • 55
  • 82
13
votes
2 answers

Handling If-modified-since header in a PHP-script

I have a PHP script which is called with an ?img= parameter. The value for that parameter is an (urlencoded) URL of an image. My script checks, if that image is already stored at my server. If not - it downloads it. After that it optionally resizes…
Alexander Farber
  • 18,345
  • 68
  • 208
  • 375
12
votes
3 answers

What is the point of If-Unmodified-Since/If-Modified-Since? Aren't they superseded by ETags?

There seem to be two distinct ways to implement conditional requests using HTTP headers, both of which can be used for caching, range requests, concurrency control etc...: If-Unmodified-Since and If-Modified-Since, where the client sends a…
rewbs
  • 1,868
  • 4
  • 20
  • 33
10
votes
1 answer

Edge does not play video if server returns 304

I've found that Edge doesn't work when playing videos for the 2nd time. My app is using a default
Andre
  • 1,422
  • 1
  • 11
  • 14
9
votes
1 answer

Why is PHP discriminating between .php and .abc extensions for caching?

There seems to be a problem between how PHP engine handles identical files that differ only in their file extension. Problem: "An If-Modified-Since conditional request returned the full content unchanged." Also, I measured that the .php extension…
Sam
  • 15,156
  • 23
  • 85
  • 134
8
votes
1 answer

Is it valid to modify a REST API representation based on a If-Modified-Since header?

I want to implement a "get changed values" capability in my API. For example, say I have the following REST API call: GET /ws/school/7/student This gets all the students in school #7. Unfortunately, this may be a lot. So, I want to modify the API…
fool4jesus
  • 1,802
  • 3
  • 19
  • 31
8
votes
2 answers

detect if a web page is changed

In my python application I have to read many web pages to collect data. To decrease the http calls I would like to fetch only changed pages. My problem is that my code always tells me that the pages have been changed (code 200) but in reality it is…
RoverDar
  • 421
  • 1
  • 11
  • 32
8
votes
5 answers

Chrome doesn't send "If-Modified-Since"

I want browsers to always add (except first time) "If-Modified-Since" request header to avoid unnecessary traffic. Response headers are: Accept-Ranges:bytes Cache-Control:max-age=0,…
GarryIV
  • 91
  • 1
  • 4
7
votes
0 answers

Internet explorer does not send "If-Modified-Since" header

I'm trying to use HTTP "If-Modified-Since" header. My server responds to every HTTP request with "Last-Modified" header. When the client sends the same request again, it updates the "If-Modified-Since" header accordingly. This works fine with…
5
votes
1 answer

Can't I set If-Modified-Since on a WebClient?

I am using WebClient to retrieve a website. I decided to set If-Modified-Since because if the website hasn't changed, I don't want to get it again: var c = new WebClient(); c.Headers[HttpRequestHeader.IfModifiedSince] =…
Superbest
  • 22,124
  • 11
  • 54
  • 129
4
votes
1 answer

When does a webbrowser send If-Modified-Since?

I'm serving a dynamically created recent.rss via python flask and naturally that way it is always sent via 200 OK. I was going to fix this by setting the header Expires a week into the future and checking if the browser sent If-Modified-Since. If so…
Steffen
  • 783
  • 1
  • 6
  • 17
1
2 3 4 5 6