Disable Cache

I’m looking to disable the cache completely from cs-cart.



Any suggestions?

There was a way to do it on the 2.0.x version and it was posted somewhere but I am having trouble locating the thread. I’ll post it if I find it again. I think the caching system SUCKS no matter how they try to spin it but that’s just me…

I would appreciate knowing how to disable cache for v2.1.2 too.



The cache problems are particularly especially significantly worsen ever since I upgraded to v2.1.x.



And I’ve lost > 60% of my traffic due to my site keep being crippled by sqlite errors due to cache.



Helpdesk told me that upgrading to v2.1.2 will resolve the issue. But it did not, and is still the same.



For those who disabled caching, is the cscart script putting heavy load on mysql without caching?

You guys can try what I did. I have not had any issues since eliminating most of the cache. Just backup your “class.cache_backend_sqlite.php” file and replace the code with below:



Hope it helps.


```php
/***************************************************************************

  •                                                                      *
  • Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved. *
  •                                                                      *
  • This is commercial software, only users who have purchased a valid *
  • license and accept to the terms of the License Agreement can install *
  • and use this program. *
  •                                                                      *

****************************************************************************

  • PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
  • “copyright.txt” FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *

    ****************************************************************************/





    //

    // $Id: class.cache_backend_sqlite.php 10502 2010-08-24 14:17:24Z zeke $

    //



    if (!defined(‘AREA’)) { die(‘Access denied’); }



    /**
  • Cache backend class, implements 4 methods:
  • get - get data from the cache storage
  • set - set data to the cache storage
  • clear - clear expired data
  • cleanup - delete all cached data

    */

    class Cache_backend_sqlite {



    static private $_cache_handlers = array();

    static private $db;



    static function set($name, $data, $condition, $cache_level = NULL)

    {

    }



    static function get($name, $cache_level = NULL)

    {

    }



    static function clear($changed_tables)

    {

    }



    static function cleanup()

    {

    }



    static function init()

    {

    }

    }



    ?> ```

[quote name=‘Ion_Cannon’]You guys can try what I did. I have not had any issues since eliminating most of the cache. Just backup your “class.cache_backend_sqlite.php” file and replace the code with below:



Hope it helps.


```php
/***************************************************************************

  •                                                                      *
  • Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved. *
  •                                                                      *
  • This is commercial software, only users who have purchased a valid *
  • license and accept to the terms of the License Agreement can install *
  • and use this program. *
  •                                                                      *

****************************************************************************

  • PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
  • “copyright.txt” FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *

    ****************************************************************************/





    //

    // $Id: class.cache_backend_sqlite.php 10502 2010-08-24 14:17:24Z zeke $

    //



    if (!defined(‘AREA’)) { die(‘Access denied’); }



    /**
  • Cache backend class, implements 4 methods:
  • get - get data from the cache storage
  • set - set data to the cache storage
  • clear - clear expired data
  • cleanup - delete all cached data

    */

    class Cache_backend_sqlite {



    static private $_cache_handlers = array();

    static private $db;



    static function set($name, $data, $condition, $cache_level = NULL)

    {

    }



    static function get($name, $cache_level = NULL)

    {

    }



    static function clear($changed_tables)

    {

    }



    static function cleanup()

    {

    }



    static function init()

    {

    }

    }



    ?> ```[/QUOTE]



    Anyone can tell me where can I find “class.cache_backend_sqlite.php” file in 2.0.12 ?



    Thanks.

[quote name=‘michael’]Anyone can tell me where can I find “class.cache_backend_sqlite.php” file in 2.0.12 ?



Thanks.[/QUOTE]



Try under



/public_html/core/cache/

[quote name=‘D-Litz’]Try under



/public_html/core/cache/[/QUOTE]



As I checked, there is no such folder, only has “db” and “templater_plugins” folder under “core”.



Thanks all the same !

Just got replied from cscart: The mentioned file (and the “core/cache” folder) exists only in CS-Cart version 2.1.1 and higher, so there is no such a file in your version.

I’m also having serious issues with server load.



Cache is on file in my config.



Should I change to SQL lite?

Have you tried the file option for cache?



2.1.1 has had serious load issues,



It kept overloading our mysql server



Stephen

[quote name=‘djstevie84’]Have you tried the file option for cache?



2.1.1 has had serious load issues,



It kept overloading our mysql server



Stephen[/QUOTE]



The file cache option is working fine for you?

I have a problem where TOOO MUCH DIRECTORIES are created for file cache option. And if I do a cache refresh, it will take FOREVER to delete the directories recursively since each directory contains 1 cache file inside. (example of directories are pfilter_xxx, cfilter_xxxx, addons, block_xxx)

Basically caching is a NIGHTMARE issue for me.

Even though magento is a bitch to configure and customize, n is heavy on the server at times, but it does not fail on such basic level. Sigh~

[quote name=‘updateshop’]I’m also having serious issues with server load.



Cache is on file in my config.



Should I change to SQL lite?[/QUOTE]



If you are not using much of filters, product features functions and do not have too many categories, sqlite version should work fine for you.

Is there any update to disable this on 2.0.12 ?

[quote name=‘michael’]Is there any update to disable this on 2.0.12 ?[/QUOTE]



Does anyone know how to disable the cache on v2, please? It seems utterly extraordinary - and yet totally in keeping with CS-Cart - that there’s not an obvious, easy way to do it. Following an update to the latest version, I’m currently fighting my way through a thousand and one theme changes on my local test server…and it’s going to take the rest of my life (and the rest of my sanity) if I have to manually clear the cache every time I make a code change.



Any help will be gratefully received. Many thanks.

@iankgrant - You may be confusing “the cache” (Registry cache) with the compiled pages.



In 2.1.2, you can use Development Mode (down by the Close Store link). This will not cache your pages while you’re developing (I’m not sure if they are cached for the customer view or not). At a minimum, any VIEW STOREFRONT started from your admin panel will NOT have the pages cached.



Disabling the Registry cache will put quite a load on your msqld since it will have to load all the settings and everything else at every page load. Filters and Features are what cause the most problems with caching. It is because each combination is a unique entry. But forcing these to be resolved via DB lookups rather than cached results will not help you.

[quote name=‘tbirnseth’]@iankgrant - You may be confusing “the cache” (Registry cache) with the compiled pages.[/QUOTE]



Yes, you could be right about that! So, next question…is there a way of disabling the compiled pages so that any template changes are shown immediately? That seems to be active regardless of whether I’m in Development Mode or where View Storefront has been launched from…



Thanks for your help. Very much appreciated.

I’m not actively using 2.1.x (I’m at 2.0.15 since it’s stable).



As I understood development mode, it will not cache your pages.



The other advantage of using hooks is that once you introduce a hook file, it is the filename that’s cached and not the content. Hence it can be freely modified in real time.

Bump…



Would be great if someone could post how to disable cache in 2.0.x?



We just moved to a super fast dedicated server and we disabled the file_put_contents function and it was faster not caching but that function is used by other things than the cache.



Thanks

Think I figured it out.



There was an old thread that had you commenting out much of the lines from the private static function _set_cache in class.registry.php. On our 2.0.15 when you do that, site just returns a white screen. I tried commenting out just the fn_file_put_contents call but that didn’t work either, plus these solutions are only disabling the cache write, so the site will still keep reading the directory checking for files.



The solution was to insert a: return true; as the first line in both the _set_cache and _get_cache functions. Seems to work. No files are written to the cache directory anymore but it still writes to the var/compiled directories.



I’m still wondering though if there is a more elegant upstream disable of cache method that would prevent any file caching functions to run at all. This may be the best solution. Site runs great but we have a dedicated quad core running with 8GB RAM and 500GB RAID Array and very few other sites doing much else on the server and only about 750 products and no filters. So YMMV disabling the file cache for you 2.0.x users depending on your store size/config and hosting setup.



Still reading lots of horror stories / disappointments regarding caching even on 2.1x. What good is a cache if it eventually bogs down your DB or makes your site run slow and you have to keep clearing it? It seems to me CS-Cart only even went down the cache path because their software architecture is sensitive to lower-performance hosting setups. So I’m guessing the cache was originally created to address performance issues with people on shared servers and/or large/complex stores?

You may want to start listing the “exact” version of CS-Cart you are running & referring to considering there have been several changes/improvements made to the cache system from 2.0 - 2.1.4.



Depending upon which version you were testing when determining that your site performs better without cache, you may see entirely different results on 2.1.4 for example.


[QUOTE]Still reading lots of horror stories / disappointments regarding caching even on 2.1x.[/QUOTE]



You will not find many (if any) people complaining about the current results they are rcvng while running live stores on 2.1.4, again the accumulation of improvements to the cache system as well as several other important areas have actually prompted many of the users which were “holding out” to now take the plunge.