Jump to content

Is it possible to minify the whole prestashop codebase?


Recommended Posts

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

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

  • 4 weeks later...

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

  • 1 month later...

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

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

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

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

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

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

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

×
×
  • Create New...