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
1
vote
0 answers

How to set up cache-control on a 304 reply with Spring-security

While using spring-security default CacheControl for all my dynamic end-points, I am trying to make browsers cache my static resources... thus i override the ResourceHandler for them as follow: @Configuration @EnableWebMvc public class WebConfig …
1
vote
0 answers

How to handle HTTP response caching on asp.net core and rest api?

We are creating a rest api in our asp.net core project. For managing the cache we use the response cache middleware and the responseccache attribute that adds these headers to the response : Cache-Control: public,max-age=2592000 Now what I would…
remi bourgarel
  • 9,231
  • 4
  • 40
  • 73
1
vote
0 answers

Last-modified header doesn't work after second refresh

I want to load photourl from buffer if no change, but it works only after first refresh of page. When I open page for first time this is my response Cache-Control no-cache Content-Length 12279 Content-Type text/plain Date Thu, 18 Aug 2016 10:26:45…
1
vote
2 answers

Is there an existing solution for WebRequest caching in .NET (based on If-Modified-Since)?

I have an expensive WebRequest that I know can be cached. Is there an existing solution that allows caching of web requests based on Last-Modified/If-Modified-Since and (optionally) ETags?
Andrey Shchekin
  • 21,101
  • 19
  • 94
  • 162
1
vote
1 answer

System.Net.Http.HttpClient adding If-Modified-Since header

I am attempting to issue an Http Get request from a windows universal app and seeing an odd behavior. (not sure if the fact that it is a universal app is related or not). The simplified code in question is this: var client = new HttpClient(); var…
dkackman
  • 15,179
  • 13
  • 69
  • 123
1
vote
1 answer

Perl Mechanize : Get the response page after the page is modified?

I am trying to retrieve a page which uses js and database to load. The loading takes about 2 to 3 mins. I am able to get the page where it would show "Please wait 2 to 3 mins for the page to be loaded." But not able to retrieve the page after it is…
b0b
  • 33
  • 5
1
vote
0 answers

Why is If-Modified-Since sent by Firefox but received by PHP blank, only on one server?

I've a fair bit of experience with HTTP, headers, browsers, javascript, PHP, and all this related hoo-hah, but this one has me stumped. I've written a Javascript RESTful frontend using the Dojo javascript toolkit. One component of it is a RESTful…
Neek
  • 7,181
  • 3
  • 37
  • 47
1
vote
2 answers

Get Browser to send both If-None-Match and If-Modified-Since

My Browser isn't sending back an If-Modified-Since Header for PHP generated Content on the first request my script sends: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 X-Powered-By…
Glen
  • 11
  • 2
1
vote
0 answers

Mocking or Stubbing mtime for File::Stat

My object GETs a file over HTTP. It does so, using the If-Modified-Since header. If the files has not been modified since the time in the header a Not Modified response will be returned and the file should not be fetched&written. Like so: class…
berkes
  • 26,996
  • 27
  • 115
  • 206
1
vote
0 answers

Does Java Web Start caches resources or ever uses If-Modified-Since?

A browser can cache resources such as a picture, and sends header with If-Modified-Since so a servlet can check and return 304 if it's not modified. So what about Java Web Start? Does it ever do this? I checked that my java web start doesn't have…
Hai Bi
  • 1,173
  • 1
  • 11
  • 21
1
vote
1 answer

What is the age of an entity in HTTP/1.1 land

I have been struggling with this question for several days. What is the age of an object stored in a cache. In particular, I am wondering about Cloud Front. If I specify Cache-Control: max-age=60, public when I upload it at T = N, and then 10…
jpayne
  • 111
  • 1
  • 8
1
vote
1 answer

Rails 3 HTTP-header If-Modified-Since using curl

I have a simple out of the box rails server running and I am trying to figure out how to make it work with the If-Modified-Since header. I am using the following curl request. curl -I localhost:3000/shows/1 --header 'If-Modified-Since: Thu, 21 Jun…
JonathanC
  • 967
  • 11
  • 30
0
votes
0 answers

Implementing HTTP etags in Spring WebFlux controller

For Spring MVC there is a very nice and straight-forward way to implement etags in response headers (https://www.baeldung.com/etags-for-rest-with-spring), however cant find something similar for Web Flux (with reactive controllers). Anyone know if…
0
votes
0 answers

if http head contains this two 'If-Modified-Since:' and 'If-None-Match: in header', then request alway 400

when i visit http://xxx/xxx.html , first time is ok. But when i press F5, this url return 400. The different between them is that the bad request 400 alway contains two header . If-Modified-Since: Thu, 30 Jun 2022 06:07:36 GMT …
lf pan
  • 1
0
votes
1 answer

How to make GitHubUserContent use If-Modified-Since?

I need to fetch JSON file published in a GitHub public repository, but only if it was modified since last time I checked. How can I make GitHubUserContent to take If-Modified-Since into account? Unlike my earlier question, now GitHub does allow…
wass rubleff
  • 326
  • 1
  • 14