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

How to fix browser cache and notmodified respond for JSON? jQuery.ajax({ifModified:true,cache:true}) JSON request break on data respond

How to fix browser cache and notmodified respond for JSON? jQuery.ajax({ifModified:true,cache:true}) JSON request break on data respond. First time browser request http://localhost/api returns status 200 OK and nexts 304 Not Modified $.ajax({ …
Binyamin
  • 7,493
  • 10
  • 60
  • 82
3
votes
1 answer

getting a http-304-status, but still data is transfered

I am wondering about this observation: I load a website for the second time and the network-module in firefox developer-tools tells me, e.g. for the html document: status=304, type=html, size=60kb. Some other assets of type=js or css are also…
yogi
  • 67
  • 6
3
votes
1 answer

Efficiently working with a 304 response status code in angular

I know that when the server returns 304 NOT MODIFIED, the browser handles it transparently and there's no way for any client code to make direct use of it. My problem is that the list is really huge (>4 MB uncompressed) and converting it to JSON…
maaartinus
  • 44,714
  • 32
  • 161
  • 320
3
votes
0 answers

Browser caching after login/logout

I've got a site with a basic login/logout system. When I display pages I do a check to see when the page was last modified and if the browser has sent an if modified since header. If it hasn't been modified I send a 304 header and exit. This…
3
votes
1 answer

Rack::Lint::LintError on get asset request

I faced strange issue in production (I can't reproduce it in development mode). Steps: Go to site: browser loads site, all assets it's ok Refresh page: browser checks assets changes with GET request with If-Modified-Since header Server responses…
3
votes
1 answer

Fetching data from API that requires If-modified-since, using request.js in node,js

I'm making a proxy to the 4chan API. I'm using request.js in Node.js + Express to make the queries to the API and I don't know how exactly implement the "If-modified-since" that the API requires, this is the code: app.get('/api/boards',…
nbreath
  • 100
  • 2
  • 9
3
votes
2 answers

jQuery ajax ifModified not honored on call for cached response when should be 304

I'm using jQuery ajax to retrieve json from an ASP.Net MVC app and I'm not seeing expected results when making ajax calls where ifModified = true. I'm using jQuery 1.9.1 and Chrome Version 26.0.1410.64 m When using a new browser instance and making…
Lee Greco
  • 743
  • 2
  • 11
  • 23
3
votes
0 answers

HTTP 304 Not Modified Response Taking Several Seconds

I am building an ASP.NET application. I'm experiencing some slow load times so I checked out the traffic using Fiddler. It seems that the page itself is loading in around 3 seconds. OK, it's kind of slow, but what baffles me is how long the js, css,…
A.P.
  • 123
  • 1
  • 6
2
votes
2 answers

Is it possible to return a 304 Not Modified with .htaccess

If a user has a file cached in their browser and they send a http request with an If-Modified-Since header, is there a way to automatically serve them a 304 Not Modified response using .htaccess?
skibulk
  • 3,088
  • 1
  • 34
  • 42
2
votes
1 answer

YSlow Primed Cache - Wrong Pie Chart

The problem that i have is like this: I did a YSlow test and under the Statistics Pie Chart View i have a wrong pie chart diagram. The Empty cache displays 11 requests and the primed cache displays 2 requests. Now one of the two request is a…
owsata
  • 1,105
  • 1
  • 11
  • 24
2
votes
1 answer

ASP.NET MVC2 Browser caching with HTTP304 Status Code

In the company I work for, we have a web application developed with ASP.NET MVC2 and hosted on IIS7. In a specific action, we return a JsonResult object holding an array. This array is updated daily; so any request coming in the same day will end…
SadullahCeran
  • 2,425
  • 4
  • 20
  • 34
2
votes
0 answers

Getting error Uncaught SyntaxError: expected expression, got '<' while loading react js web app from server

I am new in react, I developed application and it is deployed on server but now getting errors as Uncaught SyntaxError: expected expression, got '<' Also in bundle.js and other build js files loading shows 304 status code. Please help me in this.
Lucky
  • 325
  • 1
  • 3
  • 16
2
votes
1 answer

Detect a 304 redirection on an AJAX request

is there a way to detect whether an AJAX request has been redirected through a 304 response ? I tried an onreadystagechange with xhr.status==304 but got nothing. Are we only bound to 200 response codes ? The issue was already raised on SO but I…
Cystack
  • 3,301
  • 5
  • 35
  • 33
2
votes
0 answers

Status 200 (from disk cache) and 304 Not Modified issue

I'm using Next.js custom server, which by default sends strong ETag header on each page GET request. For each request I also manually add Cache-Control header res.setHeader('Cache-Control', 'public, max-age=${60 * 60}, s-maxage=${60 * 60 * 24},…
2
votes
1 answer

Internet Explorer FORCES a 304 when ajaxing a login status check

I've got an IE-specific ajax login status request problem occurring in a demo site I'm creating for my company. In every internet explorer browser (7-9), this problem occurs, while it works like a champ in ALL others: after succsesfully logging in,…
Rimer
  • 2,054
  • 6
  • 28
  • 43