8

rails s=>

Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2011-10-11 03:37:03 -0900
Served asset /application.css - 304 Not Modified (0ms)


Started GET "/assets/home.css?body=1" for 127.0.0.1 at 2011-10-11 03:37:03 -0900
Served asset /home.css - 304 Not Modified (0ms)


Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2011-10-11 03:37:03 -0900
Served asset /jquery_ujs.js - 304 Not Modified (0ms)


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2011-10-11 03:37:03 -0900
Served asset /jquery.js - 304 Not Modified (0ms)


Started GET "/assets/home.js?body=1" for 127.0.0.1 at 2011-10-11 03:37:03 -0900
Served asset /home.js - 304 Not Modified (0ms)


Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2011-10-11 03:37:03 -0900
Served asset /application.js - 304 Not Modified (0ms)

I get these message every time when page reloads.

How can i get rid of this message?

cola
  • 12,198
  • 36
  • 105
  • 165

3 Answers3

14

As DGM indicated, I was able to suppress most of these messages via modification to the development.rb file, specifically changing:

config.assets.debug = true

to

config.assets.debug = false
Christian
  • 799
  • 7
  • 15
  • Not sure why it's not working for you, I tested it on Rails 3.2.8 and it seems to work. Also, as I mentioned, it won't suppress all the messages; it will still tell you when it serves something like "application.js" for instance. – Christian Nov 10 '12 at 00:29
  • Hey Chris, sorry my mistake, i'm on Rails 3.2.3, that's probably why! Just for everyone else, this has fixed it for me http://stackoverflow.com/questions/6312448/how-to-disable-logging-of-asset-pipeline-sprockets-messages-in-rails-3-1 – flunder Nov 15 '12 at 22:05
1

In development mode, it does not cache javascript or css, but rather reloads it on every call so you can see changes made.

You could either run another environment:

RAILS_ENV=production rails s

or set the config line in config/environments/development.rb

config.action_controller.perform_caching = true
DGM
  • 26,629
  • 7
  • 58
  • 79
  • Hmm, rails 3.1 asset pipeline may have another config name, but I think the theory is still the same... – DGM Oct 11 '11 at 08:19
0

Many times, I open another terminal window in order to control what's displayed with a command like the following:

tail -n 99 -f log/development.log| grep -e "^$" -v --line-buffered | grep -v "304 Not Modified"

That way, I don't have to turn off debug mode--while I'm developing--and have better control over what I strip out of the console window.

In the example above, I chose to strip out blank lines (grep -e "^$" -v) and the annoying "Served asset /views.js - 304 Not Modified (0ms)" lines (grep -v "304 Not Modified").

Note that I added the --line-buffered argument to the first grep command to allow all tail output to immediately flow through the pipeline.

l3x
  • 30,760
  • 1
  • 55
  • 36