Question About Rebuild Cache Automatically

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.

Hi,

This feature is available only for JavaScript > [color=#ff0000]config.tweaks.dev_js[/color]( on file config.local.php ), you can also do for css but the theme will broke because [color=#ff0000].less[/color] 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

[color=#808080][size=2]part of hungryweb.net[/size][/color]

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.

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.

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.

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.