-
Notifications
You must be signed in to change notification settings - Fork 755
Caching of components with prerender:true #407
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
Comments
Hmm looks like there was some discussion at #156 (comment) Would it make sense to just cache the output always? If parameters don't change then I think yes. |
Make sure you have Regarding caching, how about applying the cache in your view? For example: <% cache ["v1", todo] do %>
<%= react_component("Todo", {todo: todo}, prerender: true %>
<% end %> (from DHH's key-based cache expiration) I figure, if there's already a robust caching system in Rails, why add another (more bug-prone) one here?! 😬 |
I completely agree. If the cache already exists in rails, then why recreate it. Regarding your other suggestion...I did try
I googled for a while and I couldn't find anything. My project is open sourced at https://github.com/amir20/radiowitter so you could try adding Meanwhile, I will use cache but if you know why that error happens, then I would really appreciate it! |
So I have removed every line until it worked and the culprit is |
Sorry about the incompatibility, I know ExecJS has some limitations! I hope you found something that worked for you. |
I apologize if this question has been asked before. Does it make sense for
prerender
to take about 700ms locally but only 80ms when disabled?I looked at the code and found that it doesn't look it is being cached. Could it be cached in production mode?
If it is already cached and I missed it, then D'OH!
The text was updated successfully, but these errors were encountered: