-
Notifications
You must be signed in to change notification settings - Fork 242
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
Charts rendered only when browser refreshes when using page caching #212
Comments
I've managed to instantiate the charts using jquery |
@lamoglia could you please explain exactly how you implemented this? I'm having the same issue but I fail to understand how to instantiate the chart using jquery. Thank you in advance. |
I've forked this repo and changed how the chart is inserted and the specs (see commit https://github.com/lamoglia/lazy_high_charts/commit/011af5f7574b678c4fb5d35c5b579c90bbc663c2).
|
cool, if the tips is good, please pr. |
Sure. Did it work for you @Goncalo-Almeida ? |
Sorry for the delayed response. |
Hi! Thanks for this @lamoglia :) |
I noticed that when I'm using page caching (gem 'actionpack-page_caching'), the charts are rendered only when a full refresh is made (i.e. not when navigating to the chart page using internal links, only when pressing f5).
I think it may be something related to encapsulate_js method in layout_helper.rb : it checks for the referrer (request_is_referrer) to conditionally renders a block of js, and when the page is fully cached, it doesn't have the chance to render it differently on the second call (when not refreshing).
Anyone already experienced this? Any thoughts on using page caching with lazy_highcharts?
The text was updated successfully, but these errors were encountered: