Questions tagged [http-status-code-304]

The HTTP response status code 304 Not Modified

Indicates the resource has not been modified since last requested. Typically, the HTTP client provides a header like the If-Modified-Since header to provide a time against which to compare. Using this saves bandwidth and reprocessing on both the server and client, as only the header data must be sent and received in comparison to the entirety of the page being re-processed by the server, then sent again using more bandwidth of the server and client.

Related tags

See also RFC2616.

181 questions
1
vote
0 answers

Has been HTTP 302 redirect modified

I think it is not possible, but I will ask experienced people for advice. Imagine the situation: A client send a request to get a content A, i.e. www.server.com/content/1. A server process the request, and generate a redirect link (every request =…
1
vote
1 answer

How to avoid response body on http 304 in nginx?

I am using nginx version 1.10.3 to serve files to browser. In my server logs I am seeing response body on 304 response. How to avoid that? Nginx log: "GET /test/testfile.js HTTP/1.1" 304 2476 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64)…
Sathya
  • 233
  • 1
  • 4
  • 13
1
vote
1 answer

How does validation work in case of a browser cache, proxy cache and an origin server?

See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Freshness when the cache receives a request for a stale resource, it forwards this request with a If-None-Match to check if it is in fact still fresh. If so, the server returns a 304…
1
vote
0 answers

Need to return 304 with Node Express rest api for images

I have a rest api that serves images. Each url will always return the same file, eg: https://example.com/rest/file/organisation/table/1234.jpg. However the actual files do not reside under the www filesystem. As a result it appears that express…
minisaurus
  • 1,099
  • 4
  • 17
  • 30
1
vote
2 answers

Images not returning with 304 response code due to rewrite module

In our ASP.NET web application, we use our own class to act as a rewrite module. It takes all requests to the server, acting as a bootstrapper. To access an image on our web application, the browser requests domain.com/ResourceItem.aspx?Id=74 Does…
Greg
  • 21,235
  • 17
  • 84
  • 107
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

rails link_to causing 304 not modified

I have a line in view that <%= link_to 'text', path_to_controller_action, remote: true, class: "button" %> that will trigger the controller action but work like an AJAX call so the user will stay on the page. It was working fine for a while but…
namesake22
  • 345
  • 2
  • 12
1
vote
1 answer

Does AMF support caching?

In other words: Can I respond with a 304 and have it "just work"?
Franky-D
  • 450
  • 4
  • 16
1
vote
1 answer

Is it correct to respond with 304 to non-conditional PUTs if no update was necessary?

I have a somewhat-RESTful API with a resource where I unconditionally PUT data to ensure it exists and is up-to-date. E.g.: PUT /users/username/ HTTP/1.0 Content-Type: text/json {"email": "username@example.org"} Performing such requests, I don't…
1
vote
0 answers

JS asset loaded empty with 304, instead of 200 (from cache)

I've noticed that when I refresh my app one of my JS assets is sometimes loaded with 304 response, while mostly it is loaded with 200 (from cache). It wouldn't be a big deal, if it would actually load it - whenever I get 304, the file is not loaded…
1
vote
0 answers

How to retrieve data, when jqxhr get 304 response

I am creating an ajax request, where I get some data returned from server with 200 OK response code. The request header uses if-modified-since to get a 304. My question is that when there is a 304 response, the data is not available in jqxhr…
Gr. Mish
  • 31
  • 3
1
vote
2 answers

MEAN stack - Express - Page getting cached in IE 11 - 304 status code

I am using MEAN stack to develop my application. The application is working fine in chrome but when the page is opened in IE, and when user request for a page, I get 304 status from the server. Because of this cached page is served back to the user.…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
1
vote
1 answer

How to use Etag with sailsjs

I'm trying to improve the cache capabilities on my sails application. Sails generate a Etag with its response but when I try to do a GET request with a header 'if-None-Match' containing the Etag from the previous answer I can't get a 304 not…
adc06
  • 793
  • 8
  • 23
1
vote
0 answers

HTTP Status 304 when loading SVG in IE9

I get an HTTP Status 304 when loading SVG's into my webpage using IE9. The SVG's have never been loaded before so they should not be in the cache. I have read alot of topics and so far I've tried fiddling with the IE 9 options and adding meta…
Anonymoose
  • 2,389
  • 6
  • 36
  • 69
1
vote
1 answer

Why does express' sendFile function treat 304 as errors?

I have an expressjs server which send's files to its clients using the sendFile function. I use the function's callback to know when errors occur. Now it seems that whenever sendFile decides to respond with 304 (which is desired behaviour in my…
Shawn
  • 10,931
  • 18
  • 81
  • 126