-
Notifications
You must be signed in to change notification settings - Fork 35
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
it it possible to cache? #19
Comments
Thanks for asking. Can you tell me your use case for it? Thanks. |
i have model Foo in views/foos/show.html.haml i have - if @foo.description.present?
- meta description: @foo.description
- meta og: {description: @foo.description} typically i would put such stuff under - cache @foo but that doesn't work in this case because meta doesn't generate strings, it adds things to the |
Could you present an idea on how you'd like to do this? You don't need to Would you have caching on both the definition and the rendering, or just Thanks. Lasse Den fredag den 18. juli 2014 skrev John Bachir [email protected]:
|
I think we can do this by adding a helper. I'll think about this. |
i searched around for how others use fragment caching for content_for stuff and it seems to not be done, or possible. if metamagic wanted to do its own internal system, the user would have to provide a key. so in my case: - meta description: @foo.description, cache_key: @foo.cache_key
- meta og: {description: @foo.description}, cache_key: @foo.cache_key and then it uses a combination of the cache key and the thing being cached (og:description etc) as the cache key in the rails cache system. i don't know how the default values ( |
I think we could do it something like this:
Not sure about the name though. I'll see if we can do something to just use "cache". This would, in the view, check if the given cache key exists, if not then run the block so the values are set. Makes sense? |
Hi @lassebunk, sorry for not responding to this! What you propose indeed looks interesting. Ideally we could go even further and "flatten" the output into the template's cache. But like I said, I think this would require re-implementing metamagic to not depend on content_for. But I haven't dove into the code to fully explore/confirm this. Let me know what you think and how much your interest is, and maybe I'll look into it a bit more. |
Hi, Thanks for the nice gem ! It's been working perfectly until I started using caches_action. I can't find any rails way to do this. Neither any metatags gem to help. Is this still under consideration ? Or do you have any idea how to do this: have page specific meta tags with caches_action, layout:false enabled ? (posted on SO as well) Thanks ! Best |
Do you have any ideas for how to fragement cache the tags metamagic generates?
The text was updated successfully, but these errors were encountered: