Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rake dev:cache task to enable development mode caching #19091

Closed
wants to merge 1 commit into from

Conversation

Sonopa
Copy link

@Sonopa Sonopa commented Feb 26, 2015

Running rake dev:cache will create or remove tmp/caching-dev.txt. When this file exists config.action_controller.perform_caching will be set to true in config/environments/development.rb.

Fixes #18875.

@pixeltrix
Copy link
Contributor

I'm 👍 on the idea of being able to easily toggle caching in development mode since more than once I've accidentally committed it after toggling it to true in development.rb whilst checking something. However I think this implementation isn't the right way to do this.

The two that readily spring to mind are:

  1. CLI option: rails s --perform-caching=true
  2. Environment variable: RAILS_PERFORM_CACHING=1 rails s

Wdyt @rafaelfranca @carlosantoniodasilva @jeremy ?

@rafaelfranca
Copy link
Member

1 seems good to me.

@rafaelfranca
Copy link
Member

cc @dhh since he created the original issue.

@carlosantoniodasilva
Copy link
Member

👍. I think the original idea/pattern of using tmp/somefile.txt came from Basecamp, they are using that like feature toggles apparently. I'm not sure we're going to use that for any other thing right now, though, but the idea is that you don't need to manually restart the server.

I sort of like being able to do that from the rails server command, I'd not mind that being the only way for doing this. But lets see what else this pattern can be useful for first.

@dhh
Copy link
Member

dhh commented Feb 27, 2015

rails s --perform-caching=true only works when you're the one starting the server manually. That's not compatible with, say, Pow.

@Sonopa Sonopa force-pushed the master branch 2 times, most recently from c33219d to 3b0f727 Compare March 3, 2015 08:19
@magikid
Copy link

magikid commented Dec 18, 2015

It looks like this issue has been merged in with PR #20961. Can this one be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rake dev:cache
7 participants