According to the Ruby on Rails Guide: Caching, caching is disabled by default in the development and testing environments. If I make a small CSS change, run rails server
and access my site at localhost:3000
, I can see my change. However, if I access my rails server on my iPhone at 10.0.1.2:3000
, the CSS doesn't update, even Chrome in Incognito Mode. When I try different iPhone that has an empty cache, the change is there.
I found a stack overflow post that described the same problem. Here were the suggested solutions:
- Remove the
public/assets
directory. I don't have one. - Add
config.serve_static_assets = false
toenvironments/development.rb
. It's already there. - Delete
/tmp/cache/assets
, addconfig.serve_static_assets = false
toenvironments/development.rb
and restart the server. I tried this and it didn't work.
Here's my relevant environments/development.rb
config:
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false