Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 example -j

  • rails g Book name:string year:integer

  • rake db:migrate

I get this error on both linux 64bit and win7 32 bit. I tried many suggestions, but couldn't get it working. Is there anyone out there able to manage this known issue? Any configuration that works (combination of gems or asset setting configuration)?

[Here's my win7 gemlist: abstract (1.0.0) actionmailer (3.1.0.rc4) actionpack (3.1.0.rc4) activemodel (3.1.0.rc4) activerecord (3.1.0.rc4) activeresource (3.1.0.rc4) activesupport (3.1.0.rc4) arel (2.1.3) bcrypt-ruby (2.1.4 x86-mingw32) builder (3.0.0) bundler (1.0.15) coffee-script (2.2.0) coffee-script-source (1.1.1) erubis (2.7.0) execjs (1.2.0) hike (1.1.0) i18n (0.6.0) jquery-rails (1.0.12) json (1.5.3) mail (2.3.0) mime-types (1.16) multi_json (1.0.3) polyglot (0.3.1) rack (1.3.0) rack-cache (1.0.2) rack-mount (0.8.1) rack-ssl (1.3.2) rack-test (0.6.0) rails (3.1.0.rc4) railties (3.1.0.rc4) rake (0.9.2) rdoc (3.7) sass (3.1.3) sass-rails (3.1.0.rc.3) sprockets (2.0.0.beta.10) sqlite3 (1.3.3 x86-mingw32) thor (0.14.6) tilt (1.3.2) treetop (1.4.9) tzinfo (0.3.29) uglifier (1.0.0) win32-open3 (0.3.2 x86-mingw32)]

like image 961
raptor Avatar asked Jun 29 '11 22:06

raptor


1 Answers

A 304 message isn't an error. When most modern browsers request a file, they also send the file's "ETag" with it to identify the version the browser currently has. If the browser's requested ETag matches the ETag on the server version, the browser will just send the 304 message instead of serving the actual file.

Essentially, it's just your app telling the browser/client "Hey, this resource hasn't changed at all since the last time you requested it, so just use your cached version. If you don't have one, then request the file again (without the ETag) and I'll give it to you."

Is something actually preventing your app from working?

like image 154
Dylan Markow Avatar answered Nov 15 '22 11:11

Dylan Markow