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
2
votes
3 answers

Indefinitely caching a HTTP response via Nginx fails

I'm trying to tell nginx to cache some of my assets (js, css) forever, or at least for a very long time. The idea is that once an asset bundle is compiled and published with an /assets/ URI prefix (e.g. /assets/foo-{fingerprint}.js) it stays there…
krukid
  • 4,285
  • 5
  • 31
  • 30
2
votes
2 answers

Using Last-Modified and If-Modified-Since on a RESTful API

I've been reading a few articles regarding setting headers for Last-Modified when a response is sent from a server. I understand the purpose for it, and how to set it, etc. I also understand the incoming If-Modified-Since header and that it's asking…
diggersworld
  • 12,770
  • 24
  • 84
  • 119
2
votes
1 answer

How to pass "If-Modified-Since" in a http request?

I am getting a collection of books from an external resource. For that i am using a call like response = book_resource.get_books({headers:{"If-Modified-Since" => last-update-date.httpdate}}) In last-update-date i saved the value of last-modified…
Gavis
  • 117
  • 11
2
votes
1 answer

Find out if the file has been modified using GWT

I'd like to know whether the image has been modified since some time using GWT. I've found that setting If-Modified-Since http header might work, so I tried to do it like in this post: RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,…
DropDropped
  • 1,253
  • 1
  • 22
  • 50
2
votes
1 answer

How to know a webpage last-modified date & time in Android Java

How can I know the date a webpage last-modified using Android Java? or how I can request for If-Modified-Since: Allows a 304 Not Modified to be returned if content is unchanged using http headers?
Hesham Saeed
  • 5,358
  • 7
  • 37
  • 57
1
vote
0 answers

Google Chrome sending If-Modified-Since header inappropriately

Running Chrome v 17.0.963.83 Having an issue with logging out of a Wordpress site that only happens in Chrome and I think I've tracked down to the HTTP headers. Workflow: you're logged in. Visit the homepage (aka site root, aka /) which has a log…
Scott C
  • 744
  • 1
  • 6
  • 19
1
vote
1 answer

DOS dir /tw switch not working

I'm trying to compare a list of files with a control file on their modified timestamp using dir /b /tw /od controlfile olderfile | more +1 this should return the controlfile as the modified date on olderfile is earlier than controlfile. However it…
citronic
  • 9,868
  • 14
  • 51
  • 74
1
vote
1 answer

Getting if-modified-since header to work with WCF

I am trying to get the "if-modified-since" header to work with my WCF web service. When a user makes a request to my service, I add an ETag to the outgoing response that contains the timestamp of the request as follows: var tag =…
SonOfPirate
  • 5,642
  • 3
  • 41
  • 97
1
vote
2 answers

Python: Optimal algorithm to avoid downloading unchanged pages while crawling

I am writing a crawler which regularly inspects a list of news websites for new articles. I have read about different approaches for avoiding unnecessary pages downloads, basically identified 5 header elements that could be useful to determine if…
jaz
  • 175
  • 1
  • 1
  • 7
1
vote
1 answer

Is using the If-Modified-Since header to filter a resource collection to only recent ones in a REST API considered a valid approach?

I'm designing a REST API where I have a need to provide the option to GET only the resources in a collection that were created or modified recently, based on a client-provided timestamp (which, in turn, will have been generated by the API in a…
VolatileCoder
  • 113
  • 1
  • 4
1
vote
3 answers

How to insert Last-Modified HTTP-header in Wordpress?

The site doesn't send Last-Modified header in its response. I know I should insert somewhere something like header("Last-Modified: " . the_modified_date()); but where?
1
vote
0 answers

Explicit if-modified-since handling in PHP script not necessary with Apache?

In some cases my PHP script is providing a large binary file. I want to support the if-modified-since header. During my tests I observed unexpected behaviour: If I set the last-modified response header in PHP then Apache seems to handle requests…
1
vote
1 answer

Insomnia headaches on a simple javascript Cache, while If-Modified-Since headers are in place!

Hello fellow earthlings! For some time I'm fantasizing possible solutions, but i'm out of clues for this strange problem. Let me describe the reason, then the problem: In order to combine the javascripts files to reduce http request, I put them into…
Sam
  • 15,254
  • 25
  • 90
  • 145
1
vote
0 answers

Why If-modified-since works with html files but not with php files

I've noticed that if you first create a webpage in html and then recreate the exact same page in php. Next check with varvy.com, or something similar, that the html file will say that the if-modified-since function is supported while the php file…
MLS
  • 11
  • 3
1
vote
1 answer

Proper way of setting up If-Modified-Since in Prestashop

I am currently working on a website, that is built on Prestashop (1.6.1.5 version to be exact). I have a problem with the correct way of setting up If-Modified-Since tag. I know that in Wordpress in order to set it up, you have to open WP-config…
KatGreta
  • 11
  • 5