Jump to content

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

Question About Rebuild Cache Automatically Rate Topic   * * * * * 1 votes

 
  • novista
  • Senior Member
  • Members
  • Join Date: 14-Jul 11
  • 199 posts

Posted 07 April 2014 - 03:17 AM #1

Hello,

I just upgraded to 4.1.3. How can I turn off the feature which merges the CSS into one file (standalone). I need to see the individual css files when looking at the source. I thought it was turning off Rebuild Cache Automatically. Whether it is on or off, I only see the standalone css. I've tried &cc and &ctpl. Any help is appreciated.

Thanks.

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1245 posts

Posted 07 April 2014 - 03:41 AM #2

Hi,
This feature is available only for JavaScript > config.tweaks.dev_js( on file config.local.php ), you can also do for css but the theme will broke because .less files will not be compiled

To enable also for css

1. on file config.local.php

#replace
$config['tweaks'] = array (
	'anti_csrf' => false, // protect forms from CSRF attacks
	'disable_block_cache' => false, // used to disable block cache
	'disable_localizations' => true, // Disable Localizations functionality
	'disable_dhtml' => false, // Disable Ajax-based pagination and Ajax-based "Add to cart" button
	'gzip_css_js' => false, // gzip compiled css/js files
	'dev_js' => false, // set to true to disable js files compilation
	'redirect_to_cart' => false // Redirect customer to the cart contents page. Used with the "disable_dhtml" setting.
);
#with
$config['tweaks'] = array (
	'anti_csrf' => false, // protect forms from CSRF attacks
	'disable_block_cache' => false, // used to disable block cache
	'disable_localizations' => true, // Disable Localizations functionality
	'disable_dhtml' => false, // Disable Ajax-based pagination and Ajax-based "Add to cart" button
	'gzip_css_js' => false, // gzip compiled css/js files
	'dev_js' => false, // set to true to disable js files compilation
	'dev_css' => false, // set to true to disable css files compilation
	'redirect_to_cart' => false // Redirect customer to the cart contents page. Used with the "disable_dhtml" setting.
);

2. on file app/functions/smarty_plugins/block.styles.php
#replace
	if ($repeat == true) {
		return;
	}
#with
	if ($repeat == true) {
		return;
	}
	if (Registry::get('config.tweaks.dev_css')) {
		return $content;
	}

I hope that helps,

---
Valentin
part of hungryweb.net

 
  • novista
  • Senior Member
  • Members
  • Join Date: 14-Jul 11
  • 199 posts

Posted 07 April 2014 - 05:29 PM #3

Thanks Valentin, seems like a long way to go for something that used to be a feature. Not sure why they disabled that from admin.

 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 09 December 2018 - 11:00 AM #4

Hi Valentin,

 

I was wondering if you have updated version of this code. It doesn't work anymore. When I followed your steps, it spitted out all "less" files without compiling it.

 

It was completely unnecessary for CS-Cart to remove this feature. It comes very handy debuggin the user side.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11264 posts

Posted 09 December 2018 - 10:22 PM #5

It does make debugging a little easier.  But unique naming of identifiers can also help.  Using a browser inspector, you should be able to do your debugging within the inspector and do your experimental changes within the inspector too.

 

CSS was combined because Google penalizes you if they're not.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 10 December 2018 - 02:44 AM #6

It also helps load time. The advent of HTTP/2 and they way render blocking CSS has been characterized since 2017 made a huge impact on the dynamics of load time.

 

Google will not penalize if I don't gzip 1MB worth of CSS and dump it on to my visitor's browser. They look at it holistically and see how my website is performing overall. They are in a much more state. They came up with AMP, they are working on HTTP/3 and many other things.

 

It all comes down to how CS-Cart utilizes these core functions. CSS - JS files should be set free from the core and there should be addons just like W3 for Wordpress.

 

Regardless, I need help with being able to put the files into HTML code separately through link rel tags. Any help would be appreciated.