/var/cache/templates/css ?

/var/cache/templates/css/somefile



This file is over 200kb and just that is taking 2.2s to load, so what I want to know is how is the file made up - from where ? because I open the file and perhaps 30% of it is comments and another 30% css not used by my site from what I can tell.



Looked at other css files in the template and they seem to be around 30k

It should be all active CSS files used in the store - from base.css, styles.css, dropdown.css and seperate CSS files contained in the /skins/customer/addons/… directories such as the styles.css for Comments&Reviews (Discussion) and my_changes, as well as those from WYSIWYG editors (lib folder) and image effects (fancybox, etc).



If you're feeling up to it, you could decipher the function for join_css and then you'll see exactly what's what.

mmm… I can see the benifit of combining them and loading all at once but I wonder it miniflying could be applied before it's done ? Jquery also has comments nearly very other line that could be removed.

Mmm… yes 25% can be saved - Compression ratio: 162.02KB/216.513KB = 25.2% (-54493 Bytes)



Now just got to see if I can do :-)

Clear your sites cache, let the cache rebuild so you know you're getting the right CSS file and then use this tool to input the full URL path to your /var/cache/templates/css/styles…css and then note the differences in file size. It brings the default cached styles.css from an install of 3.0.6 before activating any addons by 26%. If only minify could be integrated easily to minify CSS without several core hacks. Joining JS would be another thing I would love to see in CS-Cart too - why they developed JS compression, not CSS compression and CSS joining but not JS joining, only heavens knows.

Yes used something like that, what I'm think is - find the code that combines the css files and insert a function there to mimify it.



I also want to find the code that builds the site images and insert a optimise function there. The thery being I don't want my main “popup” product images to be optimised but I do want to optimise the thumbnails. This way 90% of the page views will be optimised making surfing the site quicker. But when people do choose to view a product they get a great image.

In your cs cart root directory look for the following code in config.local.php :



// Tweaks
/*
$config['tweaks'] = array (
'js_compression' => false, // enables compession to reduce size of javascript files
'check_templates' => true, // disables templates checking to improve template engine speed
'inline_compilation' => true, // compiles nested templates in one file
'anti_csrf' => false, // protect forms from CSRF attacks
'disable_block_cache' => false, // used to disable block cache
'join_css' => false, // is used to unite css files into one file
'allow_php_in_templates' => false, // Allow to use {php} tags in templates
'disable_localizations' => true, // Disable Localizations functionality
'disable_google_base' => true, //Disable obsolete google base functionality
);




If join_css is true, then your css files are probably minified and compressed into a that /var/cache/templates/css folder.

[quote name='profs77' timestamp='1364330604' post='158764']

In your cs cart root directory look for the following code in config.local.php :



// Tweaks
/*
$config['tweaks'] = array (
'js_compression' => false, // enables compession to reduce size of javascript files
'check_templates' => true, // disables templates checking to improve template engine speed
'inline_compilation' => true, // compiles nested templates in one file
'anti_csrf' => false, // protect forms from CSRF attacks
'disable_block_cache' => false, // used to disable block cache
'join_css' => false, // is used to unite css files into one file
'allow_php_in_templates' => false, // Allow to use {php} tags in templates
'disable_localizations' => true, // Disable Localizations functionality
'disable_google_base' => true, //Disable obsolete google base functionality
);




If join_css is true, then your css files are probably minified and compressed into a that /var/cache/templates/css folder.

[/quote]

They are not minified nor compressed fully, that is the issue.

I tried to use this configuration method to see if the css would turn out better, and I had a bad experience with it as well, you're better off just minifying and compressing the stuff manually.

I've seen example of compression within a folder meaning every period if files have changed in the current folder the css or js files will be compressed. You can compress on different levels leaving in comments for example. I've tried it quickly once and lost the styling but don't currently have time to look at it properly.



I'm pretty sure I can come up with a drop solution but cs-cart cecheing doesn't help. I would prefer to have one process then commeses and cheches the files at a time I want it done. IE when the site is dead.