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

UI speed: merge and compress JS and CSS files #533

Closed
mattab opened this issue Feb 2, 2009 · 1 comment
Closed

UI speed: merge and compress JS and CSS files #533

mattab opened this issue Feb 2, 2009 · 1 comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 2, 2009

following the YSlow investigation #101, the main improvement we can do to make Piwik UI faster is to use the least number of Javascript and CSS files.

Piwik is sometimes using 10 CSS and 5 to 10 JS files, that is a lot of http requests to get all these files.

A system that would merge all files, could be implemented in an ANT task for example.
It would have to work well with Plugins as all the UI code is splitted across plugins.
A script would load all JS files, merge them into one big file, minimize the javascript.
A script would load and merge all CSS files into one CSS.

Implementation idea:
- rather than including the files directly, developers would use a smarty function to load their content, eg. “include_js_file ( ‘UserSettings/js/admin.js’ )”
- this function would know if this JS file is included in the eg. “merged.js” that contains all javascript. If the file contains the JS in ‘UserSettings/js/admin.js’ then function makes sure the right javascript is returned, otherwise returns call to load the file directly from ‘UserSettings/js/admin.js’
- a script to compile JS and CSS would have to run and learn the list of files to include in which compressed file. It could read this from a static directory scheme (plugins/PLUGIN_NAME/js/\* contains all JS files, etc.) or be read from grepping the .tpl files looking for meta definition of function calls?

Notes:
- versioning files (js_045099.js) would be considered but optional especially if it makes implementation/setup harder
- we should use existing librairies that read, compress JS and CSS files. This tasks includes researching the best tool to use to do this
- how we ensure this is run at every piwik build? piwik is using Hudson for continous integration, this could for exammple be done in an ant script

@anonymous-matomo-user
Copy link

Duplicate of #660

@mattab mattab added this to the Piwik 0.9.9 - Stable release milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants