Take the 2-minute tour ×

I'm using the Google "Page Speed" plug-in for Firefox to access my web site.

Some of the components on my page is indicated as HTTP status:

200 200 (cache) 304

By Google's "Page Speed".

What I'm confused about is the difference between 200 (cache) and 304.

I've refreshed the page multiple times (but have not cleared my cache) and it always seems that my favicon.ico and a few images are status=200 (cache) while some other images are http status 304.

I don't understand why the difference.


Using Google "Page Speed", I receive a "200 (cache)" for http://example.com/favicon.ico as well as http://cdn.example.com/js/ga.js

But, I receive a http status "304" for http://cdn.example.com/js/combined.min.js

I don't understand why I have two JavaScript files located in the same directory /js/, one returning a http status 304 and the other returning a 200 (cache) status code.

share|improve this question

6 Answers 6

The items with code "200 (cache)" likely have future-dated Expires: headers that denote that they will be valid for awhile without need for refresh, or are a special case like favicons (most browsers cache them awhile without checking for changes unless you force-refresh or clear cache). When the browser receives the request for these items, it checks the cache and, if found, returns the cached version; at no time is a request made to the server.

304s, on the other hand, are the response of the server after the browser has checked if the file was modified since the last version it had cached (the answer being "no").

For most optimal web performance, you're best off setting a far-future Expires: header for all assets possible, and then when an asset needs to be changed, changing the actual filename of the asset or appending a version string to requests for that asset. This eliminates the need for any request to be made unless the asset has changed from the version in cache. Yahoo! has more cache-related performance guidelines, which include making sure that ETags are correctly configured.

share|improve this answer
So what's better to have from a speed perspective ... "200 (cache)" or "304" http status messages? –  Hank Nov 3 '09 at 3:42
200 cache. Some good notes about this here: developer.yahoo.com/performance/rules.html#expires . You want as long an expiration time as possible on your assets, but have to balance this with the fact that you lose a certain amount of control this way. One thing you can do is set long-lasting expirations on files, and then when needed increment an asset version number for those files. For example you can include style.css?v1 and increment in the <link> element to style.css?v2 when there are changes. –  Ben Nov 3 '09 at 3:46
here are the different firefox refresh methods www-jo.se/f.pfleger/firefox-reload –  Josef Pfleger Jun 19 '10 at 13:45
The max-age and age headers combined can also result in 200 (cache) results if age is less than max-age. The one exception is when the user clicks the browser refresh button, in which case a 304 header is sent. –  yitwail Nov 13 '12 at 10:24
HTML5 Boilerplate recommends against using the query string method of cache-busting - it's better to change the href, url, and src references to each file to include a 'fingerprint' (either a hash of the file or a simple incremented number), and then tell the server to strip off that fingerprint and just serve style.css or whatever. If you can't do that on the server, have your build system rename the actual files with the fingerprint. –  iono Apr 22 '13 at 4:34


304 means Firefox is sending a "If-Modified-Since" conditional request to the Web server. If the file has not been updated since the date sent by the browser, the Web server returns a 304 response which essentially tells Firefox to use its cached version. It is not as fast as 200 (cache) because the request is still sent to the Web server, but the server doesn't have to send the contents of the file.

To your last question, I don't know why the two JavaScript files in the same directory are returning different results.

share|improve this answer

HTTP 304 is "not modified". Your web server is basically telling the browser "this file hasn't changed since the last time you requested it." Whereas an HTTP 200 is telling the browser "here is a successful response" - which should be returned when it's either the first time your browser is accessing the file or the first time a modified copy is being accessed.

For more info on status codes check out http://en.wikipedia.org/wiki/List%5Fof%5FHTTP%5Fstatus%5Fcodes.

share|improve this answer
That's my understanding as well ... which is why I stated in my original post that I've refreshed my page multiple times and am still getting the "200 (cache)" for the same favicon.ico and particular JavaScript includes I have. Very strange –  Hank Nov 3 '09 at 3:45
200 actually doesn't mean cached, it just means OK. Chances are that your server configuration doesn't explicitly tell the browser to cache your ico and js files, which would make it return a status code of 200. –  richleland Nov 3 '09 at 3:51
That's not the case b/c on some of my JavaScript, I receive a 304 and other JavaScript I get a "200 (cache)". All JavaScript resides within the same web server directory example.com/js/ –  Hank Nov 3 '09 at 3:53
I should add that 200 (cache) just means it's locally cached and not actually making a request to the server, which is going to be faster than going to the server and getting a 304 response. –  richleland Nov 3 '09 at 3:54
I've updated my original post to show my live site and the JavaScript in question. Please see my updated original post. –  Hank Nov 3 '09 at 3:56

This threw me for a long time too. The first thing I'd verify is that you're not reloading the page by clicking the refresh button, that will always issue a conditional request for resources and will return 304s for many of the page elements. Instead go up to the url bar select the page and hit enter as if you had just typed in the same URL again, that will give you a better indicator of what's being cached properly. This article does a great job explaining the difference between conditional and unconditional requests and how the refresh button affects them: http://blogs.msdn.com/b/ieinternals/archive/2010/07/08/technical-information-about-conditional-http-requests-and-the-refresh-button.aspx

share|improve this answer

304 is unmodified. i get this code a lot in my media files like css and js.


share|improve this answer
So does a "200 (cache)" mean that my browser had to re-download the entire content again to then determine it hadn't changed from what was in cache? Ideally, it seems like I would want 304 status messages and not "200 (cache)" –  Hank Nov 3 '09 at 3:41
Yeah, but favicon is a file too, it's not a server script or something. –  x2. Nov 3 '09 at 3:41

This is not a answer to this question but this only place I reached when searching for a issue that took me hours to figure out. While trying things at my FTP client I switched it to ASCII mode then few days later when I uploaded one my site to live server all the images was returning with 304 status and appear with broken icon on browser. Even accessing image files directly result in same manner.

After few hours of struggle I got my mistake and switched the FTP mode back to auto.Uploaded all image files again and all loaded with 200.

like to listen why images were not working when uploaded with ASCII mode?

share|improve this answer

Your Answer


