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

How to do I integrate a 304 in Django?

When a user requests the same page, with the same data...I'd like Django to return a 304, so that the browser doesn't have to load the page all over again. I'm new to this. How can this be done? Thanks.
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
6
votes
2 answers

Browser is sending request for same content (PNG image) multiple times

I've a PNG file named icons.png hosted on an apache server. Basically this file is a combination of other small image elements (CSS Sprite). This file loads with a normal 200 OK response when the page loads for the 1st time. After the page loads;…
dibyendu
  • 515
  • 1
  • 5
  • 16
6
votes
2 answers

Prevent unwanted headers when returning 304 Not Modified with ServiceStack

Using ServiceStack, I just want to return 304 Not Modified as such: HTTP/1.1 304 Not Modified But ServiceStack adds many other unwanted (returning HttpResult with 304 code) headers as such: HTTP/1.1 304 Not Modified Content-Length: 0 Content-Type:…
Martin Tapp
  • 3,106
  • 3
  • 32
  • 39
5
votes
1 answer

Internet Explorer displaying cache data over Ajax Pull with 304 Result

I have a tool that works perfectly fine in Chrome and FF. But with any versions of IE the browser is displaying cache info over doing an Ajax pull to retrieve the data. Here's my setup: I have criterias that I loop through: @foreach (var item in…
LanFeusT
  • 2,392
  • 5
  • 38
  • 53
5
votes
1 answer

Rails 3.1.0.rc4: 304 Not Modified. Is there any known working configuration?

Trying the basic example in rails 3.1 RC 4, I get the error Compiled app/assets/javascripts/application.js Served asset /application.js - 304 Not Modified (same with .css and asset/rails.png on the default index page) My workflow is: rails new…
raptor
  • 319
  • 3
  • 5
5
votes
2 answers

304 response does not set custom header for apache with mod_headers

ServerAdmin webmaster@dev.dom.com DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" ServerName dev.dom.com ServerAlias dev.dom.com ErrorLog "logs/dev.dom.com-error.log" CustomLog…
Dominic
  • 1,294
  • 1
  • 15
  • 29
5
votes
1 answer

Remove Etag and Last-Modified headers from IIS

Did you know you can prevent the revalidation of files in browser cache and subsequent 304 response by completely removing both the ETag and Last-Modifed response headers? Of course, this is easy in Apache, but as clear as mud in IIS 6. Does anyone…
David Merrilees
  • 2,430
  • 2
  • 16
  • 15
5
votes
0 answers

Does ETag invalidate the Cache-Control header?

I am fetching a resource from my RESTful web service, and in the response I add these two headers: Cache-Control: public, max-age=120 ETag: "3D03F8066015A1438532E049AE5E16EA" The first time the browser got this response it cached it correctly for 2…
Matias Cicero
  • 25,439
  • 13
  • 82
  • 154
4
votes
1 answer

Why doesn't jquery ajax call populate data variable from cache when getting a 304 status code?

I'm using jquery ajax in my mobile app to fetch my json data via restful apis. My restful apis have been configured to support etags. My restful apis are hosted on another subdomain, so I have configured CORS to handle the cross domain calls. In my…
bmurmistro
  • 1,070
  • 1
  • 16
  • 35
4
votes
2 answers

mvc 4 bundle and minification - not getting 304 (not modified) when I refresh

I'm trying out MVC 4 Beta's bundling and minification thru System.Web.Optimization. I was hoping that the site I'm using it for would receive a 304 (Not Modified) when I hit refresh. I thought the point of the src to my js bundle,…
4
votes
0 answers

Alamofire response is always with 200 status code even when explicitly returning 304

Im trying to create some caching in my app. This is the flow: The user enter the app, the app checks weather are any changes since his last refresh, if yes, the server returns 200 and the page is refreshed. Otherwise, the server returns 304 and…
Eden.F
  • 219
  • 2
  • 6
4
votes
0 answers

IE does not return If-None-Match header over https

I have a problem with caching content using etags on IE over https. Chrome and Firefox allow me to successfully cache content using a combination of If-Modified-Since and If-None-Match The If-None-Match header is important because the same page…
3
votes
1 answer

Is server code executed when server returns http status code 304

Does/should server code run when the server return status code 304? I understand that the server should not return anything (client should use the cache), but I cant find any info on whether the server will executed the code in an api endpoint for…
tobbe
  • 1,737
  • 6
  • 23
  • 40
3
votes
0 answers

Rails 3 render_component can't handle 304? / Force ActionDispatch::Request to avoid cache

I use render_component, https://github.com/vhochstein/render_component in Rails 3. When my controller returns 304 result, the render_component fails with this error: undefined method `redirect_url' for []:Array on this line: response =…
elado
  • 8,510
  • 9
  • 51
  • 60
3
votes
1 answer

Chrome shows 200 ok status in network even if server returns 304

I am building a frontend and backend application. Using If none match header in the request, my server is returning 304 status but chrome always shows 200 status. Same implementation works well with Firefox and IE. All the headers are placed…
1 2
3
12 13