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

dragonfly should cache assets #2026

Closed
wants to merge 2 commits into from

Conversation

wenzowski
Copy link

fix for #1736

Alexander Wenzowski added 2 commits November 13, 2012 15:18
This isn't as ominous as it sounds since Rack::Cache is included in production
by default as of Rails 3.1.

Conflicts:

	changelog.md
	core/refinerycms-core.gemspec
	images/lib/refinery/images/dragonfly.rb
	images/refinerycms-images.gemspec
	resources/lib/refinery/resources/dragonfly.rb
	resources/refinerycms-resources.gemspec
@parndt
Copy link
Member

parndt commented Nov 13, 2012

Thanks for this.

I'm unsure - it adds the weight of Rack::Cache to the core when it doesn't really need it.. Can rack-cache be enabled only when it is requested by Images or Resources?

@wenzowski
Copy link
Author

Yes, it could be done.

I was hoping for a way to get Rails to inject it, but no ideas on that yet.

@ugisozols
Copy link
Member

Small note: Rack::Cache will be disabled by default in Rails 4 (see rails/rails#7838) - if that makes any difference.

@ugisozols
Copy link
Member

This PR makes Refinery::Core.verbose_rack_cache config redundant.

@wenzowski
Copy link
Author

@ugisozols yes, I noticed rails/rails#7838. The big impact that will have on this is it allows setting config.action_dispatch.rack_cache = true instead of fussing with values for the hash.

So far I've only played with Refinery on Heroku. Rack::Cache is absolutely necessary on cedar (now default stack) since Cache-Control headers don't appear to have any effect as they're no longer using varnish (correct me if I'm wrong). I can see how running Refinery behind nginx (or any fast RCP) without Rack::Cache would likely be preferable performance-wise.

@wenzowski
Copy link
Author

@parndt Ideally Dragonfly would be injected behind Rack::Cache if present else before whatever it needs to be in front of (don't know offhand).

When I first wrote this up, I recall not being able to depend on config.action_dispatch.rack_cache as an indicator of Rack::Cache injection status. It seems perfectly reliable in 3.1.3+ so that's probably the way to go.

I'll rewrite, time permitting.

@wenzowski wenzowski closed this Nov 14, 2012
@wenzowski
Copy link
Author

@parndt Durr. By config.action_dispatch.rack_cache I meant config.action_controller.perform_caching

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

Successfully merging this pull request may close these issues.

3 participants