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

Caching implementation #77

Closed
Spone opened this issue Mar 24, 2018 · 0 comments
Closed

Caching implementation #77

Spone opened this issue Mar 24, 2018 · 0 comments

Comments

@Spone
Copy link
Collaborator

Spone commented Mar 24, 2018

I'm wondering how we could implement fragment caching for the components.

(First, if you're not familiar with the topic, I suggest you read the Rails guide about caching)

Actually, we can currently wrap manually the whole component partial in a cache helper, in order to cache it. But maybe Komponent should have a built-in way to do that.

I think we could have an API similar to the render partial one, where you can pass cached: true. Something like: = component "button", cached: true
It would then rely on Rails to do the work.

The main question is: how can we define the key for the cache entry? It could be a method within the Ruby module of the component (cache_key?)

Feel free to comment with your ideas below!

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

No branches or pull requests

2 participants