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.

90 questions
4
votes
1 answer

What response should If-Modified-Since HTTP Header return if request is HEAD?

If you send a GET request with an If-Modified-Since header, the server suports it and the file hasn't changed, the server will return a 304 response. If you sent a HEAD request in the same circumstances, should the server send a 304 response or send…
PeterM
  • 2,534
  • 6
  • 31
  • 38
4
votes
0 answers

Android WebView cache doesn't expire

in my Android App I use a WebView and got a problem with caching. After a file is cached the WebView just keeps it forever (or at least until I delete the cache manually). In the Apache Access-Log I see that the WebView doesn't send requests once…
Norkos
  • 171
  • 1
  • 13
4
votes
2 answers

iOS: Send If Modified Since header with request

Does anyone know how to send If Modified Since header with a url request? I'm trying to get a status code back that will tell me if an RSS page has been updated or not. UPDATE #1: I was able to do a test doing the following: NSURL *url = [NSURL…
Sandy D.
  • 3,166
  • 1
  • 20
  • 31
4
votes
1 answer

Symfony2 delete the "if-modified-since" parameter on production

I made a API with Symfony2 for a iOS-App. The App send a GET request with the header-parameter if-modified-since "If-Modified-Since" = "Thu, 07 Nov 2013 11:50:52 GMT"; In the controller I check the parameter and return the data if the date is…
rbrueckler
  • 41
  • 2
4
votes
9 answers

Refresh image with Javascript, but only if changed on server

I want to reload an image on a page if it has been updated on the server. In other questions it has been suggested to do something like newImage.src = "http://localhost/image.jpg?" + new Date().getTime(); to force the image to be re-loaded, but…
David Maymudes
  • 5,664
  • 31
  • 34
4
votes
1 answer

Android Image loader library with support for ETags, If-Modified-Since

I've been using for some time Android Http Image Manager, and recently I switched over to Android Universal Image Loader I'm afraid neither of them have support for verifying if local cache is up-to-date. What I'm currently looking for is an Image…
Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
3
votes
0 answers

$_SERVER['IF_MODIFIED_SINCE'] nor anything else really is sent back by Safari

safari is NOT sending back any request headers & i go nuts. i'm ashamed it took me all that time to realize it (sending back 304 since a while, never realized that safari issue until now) if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) or…
mikakun
  • 2,203
  • 2
  • 16
  • 24
3
votes
3 answers

Sync local file with HTTP server location (in Python)

I have an HTTP server which host some large file and have python clients (GUI apps) which download it. I want the clients to download the file only when needed, but have an up-to-date file on each run. I thought each client will download the file on…
Uri Cohen
  • 3,488
  • 1
  • 29
  • 46
3
votes
4 answers

How to make Safari send if-modified-since header?

When I generate a page I send headers HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html; charset=utf-8 Last-Modified: Mon, 04 Apr 2011 20:08:33 GMT Vary: Accept-Encoding Date: Mon, 11 Apr 2011 01:36:21 GMT Content-Length: 3019 then,…
vadim
  • 31
  • 1
  • 4
3
votes
1 answer

Vimeo API not responding to "If-Modified-Since" header

According to Vimeo API documentation: The If-Modified-Since header enables you to return only those API resources that have been modified since a particular date and time. The header looks like this: If-Modified-Since: {ddd}, {D} {MMM} {YYYY}…
showdev
  • 28,454
  • 37
  • 55
  • 73
3
votes
2 answers

Cloudfront how to avoid If-Modified-Since header request everytime

AWS Cloudfront document says: If you set the TTL for a particular origin to 0, CloudFront will still cache the content from that origin. It will then make a GET request with an If-Modified-Since header, thereby giving the origin a chance to…
3
votes
2 answers

Parse If-Modified-Since Header (node.js)

I am trying to implement sending a 304 header for performance in a server hosting program I am writing, but I do not know how to parse the date of the If-Modified-Since header. I also would like to know how to find out if the If-Modified-Since date…
Bennett
  • 1,007
  • 4
  • 15
  • 29
3
votes
0 answers

Browser caching after login/logout

I've got a site with a basic login/logout system. When I display pages I do a check to see when the page was last modified and if the browser has sent an if modified since header. If it hasn't been modified I send a 304 header and exit. This…
2
votes
0 answers

iOS: How to know if RSS feed has been updated?

My iOS application is downloading data from an RSS feed. I know I need to save the data. Since, the application is having to download the data remotely -- it takes several seconds for the table view to update with the RSS data items. I want it to…
Sandy D.
  • 3,166
  • 1
  • 20
  • 31
2
votes
1 answer

Safari seems not sending If-Modified-Since header for main address

After looking (carefully...) in the different questions and answers of the forum (and others), I didn't find a definitive answer. When Safari requests a resource (page, image...) to a web server it doesn't provide If-Modified-Since header for the…