Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

/var/cache/templates/css ? Rate Topic   - - - - -

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 25 March 2013 - 06:09 PM #1

/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
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 25 March 2013 - 06:24 PM #2

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.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 25 March 2013 - 06:34 PM #3

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.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 25 March 2013 - 06:56 PM #4

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 :-)
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 25 March 2013 - 07:06 PM #5

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.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 25 March 2013 - 07:43 PM #6

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.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • profs77
  • Member
  • Members
  • Join Date: 26-Sep 12
  • 21 posts

Posted 26 March 2013 - 08:43 PM #7

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.

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 26 March 2013 - 09:26 PM #8

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.

They are not minified nor compressed fully, that is the issue.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • profs77
  • Member
  • Members
  • Join Date: 26-Sep 12
  • 21 posts

Posted 26 March 2013 - 09:56 PM #9

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.

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 26 March 2013 - 11:10 PM #10

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.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.