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
2
votes
1 answer

Rails default behavior: Why is Rails not generating different Etags by default or returning 304 Not Modified?

I am inspecting a Rails response. No http headers have been purposefully set to be returned from the server. The response includes Cache-Control: max-age=0, private, must-revalidate and Etag. The response is a 200 no matter how many times I make the…
2
votes
1 answer

ETag with Accept-Language

I have a web service which puts an ETag on to each response so future calls can make use of the HTTP 304 (Not Modified) status. The ETag I generate really just a Base64 encoding of the query type along with the timestamp. The problem I have is if…
Agent96
  • 445
  • 1
  • 5
  • 20
2
votes
1 answer

Disable caching in web.py web server, ignoring HTTP header

I have a web application in python, the web server is implemented with library web.py. But, when the browser send a request at the web server, at example on /static/index.html, it includes in http headers, the field 'IF-MATCH-NONE' and…
Kimas
  • 21
  • 5
2
votes
0 answers

JQuery .ajax 304 Not Modified parseerror

I have a Single Page javascript webapp that we rolled from scratch (I know I know) We have a central set of ajax defaults that work as follows: Model.defaultsLoader = function(message, config, callback, async, delay){ if(typeof delay ===…
acolchagoff
  • 1,926
  • 3
  • 18
  • 30
2
votes
0 answers

Node js with express how to enable cache for static files

I have tried all the possibilities. Following are my response headers HTTP/1.1 200 OK Expires: Sun, 20 Dec 2015 03:53:42 GMT Accept-Ranges: bytes Cache-Control: public, max-age=604800 Last-Modified: Wed, 02 Dec 2015 15:49:21 GMT Etag:…
2
votes
1 answer

How to modify Spring controller to prevent downloading a file that hasn't changed

I have an implementation similar to this one that allows the caller to ask for a specific file from the filesystem. The file is one that doesn't change frequently and is being downloaded by a mobile application. Is there a way I can change this to…
Chris Williams
  • 11,647
  • 15
  • 60
  • 97
2
votes
0 answers

Prevent angular $http.get from returning 304 response

My backend returns different data for some get requests depending on the user's session data. I would like to force angular to not use cache for certain get requests so that it can retrieve the latest data from the server. I have tried a few things…
cnaut
  • 144
  • 1
  • 12
2
votes
1 answer

How to clear an HTTP 304 response from cache?

I have a situation in which a dropdown on my asp.net MVC page is being populated by an AJAX GET request for json data. The first request returns the data with a 200 OK response. Subsequent calls return a 304 Not Modified request, and the dropdown…
Shawn de Wet
  • 5,642
  • 6
  • 57
  • 88
2
votes
1 answer

Impossible to have a 304 response when using maxage header

I am trying to cache static content, I want this content is have a lifetime of one hour and the content is public, it is the same for everyone. I have the following code in my controller: $response = new…
COil
  • 7,201
  • 2
  • 50
  • 98
2
votes
2 answers

Caching images returned from a web api service

No matter what I do I can't get images returned from a web api too cache, I am seeing a request to the server every time I request the image. I have tried many permiations for the header setting, here is my latest effort: public class…
Dan
  • 29,100
  • 43
  • 148
  • 207
2
votes
1 answer

Do I have to send the ETag again with a 304 Not Modified header?

I was playing with PHP, using ETags, IF_NONE_MATCH, etc, when a weird thing happened. I wrote the code below, which checks for IF_NONE_MATCH. If it matches my ETag, I send a 304 response header. If not, I send other headers telling the browser to…
user884248
  • 2,134
  • 3
  • 32
  • 57
2
votes
1 answer

How to get 304 response for PHP generated javascript file?

I have the following PHP file:
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
2
votes
1 answer

In Rails 3.2.3 server I get error 304 Not Modified (5ms)

I am newbie to ruby and rails for several months now.I took a class for ruby and rails which allowed me to create a restaurant blog site. Well I recently started revamping the site to make for my friend. So it's merely just changing some things…
2
votes
1 answer

200 instead of 304 in Response

Simple problem: onResponseReceive getStatusCode returns 200 instead of 304. Fiddler tells me that the Response statuscode is 304. What do I do: I constantly poll the server for new data (every 10 seconds). If the data hasn't changed, it responses…
Stefan
  • 14,826
  • 17
  • 80
  • 143
1
vote
1 answer

firefox do not send the header : if-modified-since after receive Last-modified from the response

firefox do not send the header : if-modified-since after receive Last-modified from the response. eg: visiting load a website in webview in Firefox, and after several times load this page,press F12,in the console show below screenshot. Response…
explorer
  • 449
  • 2
  • 10
  • 19