You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As soon as the stylesheets vary depending on user permissions or settings the CSS and/or JS has to be recompiled very often under circumstances.
Example:
if (Piwik::hasUserSuperUserAccess()) {
$stylesheets[] = "libs/jquery/stylesheets/jquery.jscrollpane.css";
}
if ($setting->isEnabled()) {
$stylesheets[] = "libs/jquery/stylesheets/jquery.jscrollpane.css";
}
Imagine there are multiple users active and all of them have different permissions and/or settings and/or ... For each request we might have to recompile the CSS / JS as the registered stylesheets / jsFiles are different for each user.
This was for instance the case in #5212 but solved with a "workaround". Nonetheless we (or plugin developers) might face this problem again or have already resulting in slow speed from time to time.
As a plugin developer I would not be aware of such an impact when adding files depending on different permissions etc. Plugin developers would probably also not be able to reproduce this behavior as it only happens if there are multiple active users on a Piwik instance.
Maybe we can keep different versions of the merged files depending on the CacheBuster value. For example instead of only one asset_manager_global_css.css we have asset_manager_global_css_$CACHE_BUSTER_HASH.css. Not sure about side effects etc. There might be better solutions.
The text was updated successfully, but these errors were encountered:
Maybe we should not support or use any conditional CSS or javascript, and always include all CSS and Javascript?
So one solution could be, to remove the hooks:
'AssetManager.getStylesheetFiles'
'AssetManager.getJavaScriptFiles'
and developer could only define CSS and JS assets in the plugin.json.
Then they won't be able to conditionally include assets. This would fix it. What do you think?
mattab
added
duplicate
For issues that already existed in our issue tracker and were reported previously.
and removed
Major
Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
labels
Dec 5, 2016
As soon as the stylesheets vary depending on user permissions or settings the CSS and/or JS has to be recompiled very often under circumstances.
Example:
Imagine there are multiple users active and all of them have different permissions and/or settings and/or ... For each request we might have to recompile the CSS / JS as the registered stylesheets / jsFiles are different for each user.
This was for instance the case in #5212 but solved with a "workaround". Nonetheless we (or plugin developers) might face this problem again or have already resulting in slow speed from time to time.
As a plugin developer I would not be aware of such an impact when adding files depending on different permissions etc. Plugin developers would probably also not be able to reproduce this behavior as it only happens if there are multiple active users on a Piwik instance.
Maybe we can keep different versions of the merged files depending on the CacheBuster value. For example instead of only one
asset_manager_global_css.css
we haveasset_manager_global_css_$CACHE_BUSTER_HASH.css
. Not sure about side effects etc. There might be better solutions.The text was updated successfully, but these errors were encountered: