alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

dashboard blocks cache #111

Closed skalimer0 closed 3 years ago

skalimer0 commented 3 years ago

Hello,

How it works if i want to use the same "data" (from sql request for example) in several blocks on the same dashboard ? It can be possible (it's just to optimize requests) ?

thanks

alexandermeindl commented 3 years ago

Hi @skalimer0 this is already possible. See https://github.com/AlphaNodes/additionals/blob/master/app/models/dashboard_content.rb#L63 and https://github.com/AlphaNodes/additionals/blob/master/app/models/dashboard.rb#L298. For async_params use unique_params to create a unique cache key.

This is only possible, if you use async blocks. For non-async blocks it is not possible right now.

skalimer0 commented 3 years ago

OK it's much more understanding for me

Thanks you for your return.

PS: Soon, I'll have a pull request... ;)