chasehe Posted April 25, 2014 Share Posted April 25, 2014 i am not sure whether my question will appear stupid or not. when i look into the prestashop source codes, i find all these expressive long name of variables, function names, etc., which is really great, as it helps one to understand the inner workings of prestashop. but i am also aware that such long names will, collectively, reduce the loading speed of prestashop? i know that in the javascript world, they use minifiers, uglifiers etc., to reduce the size of the source file in order to improve performance, wouldn't it be the same if we minify the prestashop codebase in the same manner(provided that it still works, of course:)). just a thought, hope to provoke something thinking and get some responses from similar, performance and speed minded prestashop users. Link to comment Share on other sites More sharing options...
dioniz Posted April 25, 2014 Share Posted April 25, 2014 You can do that in BO > Advanced parameters > Performance You can minify html, css, js... Link to comment Share on other sites More sharing options...
chasehe Posted April 25, 2014 Author Share Posted April 25, 2014 thanks for responding. i am aware of the BO operation, minifying html, css etc., my question is: is it possible to minify prestashop itself. e.g. for a function name like ControllerCore, do a find and replace and make it CC ( just to make the function name shorter) or whatever shorthand you might think of throughout the whole prestashop codebase; if all the variable names, function name etc., are changed in this way, i believe the whole prestashop download size might be reduced by 1/3(i guess?), and since the php interpreter wouldn't have to read longer function names and variable names into its memory, the performance would be improved, i guess?... Link to comment Share on other sites More sharing options...
JPresta.com Posted April 25, 2014 Share Posted April 25, 2014 HTML, JS and CSS need to be minified because there are sent to the browser through internet. The PHP code of Prestashop is not sent, it generates the HTML, so there is no need to minify it. 1 Link to comment Share on other sites More sharing options...
El Patron Posted May 23, 2014 Share Posted May 23, 2014 thanks for responding. i am aware of the BO operation, minifying html, css etc., my question is: is it possible to minify prestashop itself. e.g. for a function name like ControllerCore, do a find and replace and make it CC ( just to make the function name shorter) or whatever shorthand you might think of throughout the whole prestashop codebase; if all the variable names, function name etc., are changed in this way, i believe the whole prestashop download size might be reduced by 1/3(i guess?), and since the php interpreter wouldn't have to read longer function names and variable names into its memory, the performance would be improved, i guess?... when you down load PrestaShop it is zipped file. Link to comment Share on other sites More sharing options...
Nouvelle Vape Posted July 21, 2014 Share Posted July 21, 2014 You can do that in BO > Advanced parameters > Performance You can minify html, css, js... Hi El Patron, You say that when all ccc options are activated, the css is minified: I am a little bit surprised because: - if I minify the global.css myself with cssminifier.com, the results are amazing: load time is dramatically reduced Do you see an explanation? Do you think it is a good practice to minify css manually in complement to ccc options? Thanks Olivier Link to comment Share on other sites More sharing options...
El Patron Posted July 21, 2014 Share Posted July 21, 2014 Hi El Patron, You say that when all ccc options are activated, the css is minified: I am a little bit surprised because: - if I minify the global.css myself with cssminifier.com, the results are amazing: load time is dramatically reduced Do you see an explanation? Do you think it is a good practice to minify css manually in complement to ccc options? Thanks Olivier Hi Oliveir, I'm certainly no expert but part of CCC is compress which I equate to minify. It would be interesting to compare compression built into ps and using cssminifire.com. Fred Link to comment Share on other sites More sharing options...
vekia Posted July 21, 2014 Share Posted July 21, 2014 prestashop has got features to minify whole visible contents in browser you can minify css,js and also html contents everything you can do under adv. parameters > performance tab Link to comment Share on other sites More sharing options...
El Patron Posted July 21, 2014 Share Posted July 21, 2014 there are several .css tools out there that will minimy but others also analyze .css bottlenecks, like include...duplicate and other bad behaviors. I think it's rather interesting (not having enough time myself) to run say global.css through some of these tools, note .css is going to vary between templates and modules. if there are ways to improve your existing .css with these tools, then back up the production .css and use improved version. Link to comment Share on other sites More sharing options...
Nouvelle Vape Posted July 22, 2014 Share Posted July 22, 2014 I use ps 1.6.0.6 with slightly modified default template. The minification of global.css with cssminifier reduced file size by more than 25%. I did not measure load time difference but it was visible without measuring. I think I will minify the biggest css files that way. An other thing I plan to do is to use a tool that remove unused css selectors. I did a quick test of "Dust-me selectors" a firefox plug in. First feeling is that the file size can again be divided by 2. FYI, I am doing these tests to optimize load time of my shop (www.nouvellevape.com), mainly for SEO and for users too. Link to comment Share on other sites More sharing options...
Dh42 Posted July 22, 2014 Share Posted July 22, 2014 Be careful using dustme, one thing you have to do is make sure you poll every page of the site, or every type of page at least. It will remove global styles that are used in modules that you have disabled. If you re-enable them then they will have a broken looking style. Link to comment Share on other sites More sharing options...
Nouvelle Vape Posted July 23, 2014 Share Posted July 23, 2014 Thanks for the advice Dh42. In any case, I will keep a copy of the full css files. I am aware that it needs to be done carefully, but I feel that it is worth doing it to get a fast response time. Link to comment Share on other sites More sharing options...
Dh42 Posted July 23, 2014 Share Posted July 23, 2014 Also, a direct answer to your question that no one said, is it is possible to minify the code base in a sense. If you run an Opcode cache on your server such as APC, Optimizer, or Xcache, the compiled php files are basically minified and stored in memory. Link to comment Share on other sites More sharing options...
El Patron Posted July 24, 2014 Share Posted July 24, 2014 along with dh42 excellent points, for some extra giddy up don't forget to review javascript blocking...and that google now measures above the fold when figuring SEO. I have module for that if you are running current javascript top, it's for PrestaNerds. honestly PrestaShop does an excellent job compressing and caching, but if we have template that is not using correct framework, load all javascript bottom and best practice .css, then all the sprite squishing etc. really doesn't give us much bang for the effort. Link to comment Share on other sites More sharing options...
Recommended Posts