Much improved replacement for Zend_Cache_Backend_File - works great with Magento!

Overview

Build Status

Cm_Cache_Backend_File

The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.

This cache backend works by indexing tags in files so that tag operations do not require a full scan of every cache file. The ids are written to the tag files in append-only mode and only when files exceed 4k and only randomly are the tag files compacted to prevent endless growth in edge cases.

The metadata and the cache record are stored in the same file rather than separate files resulting in fewer inodes and fewer file stat/read/write/lock/unlink operations. Also, the original hashed directory structure had very poor distribution due to the adler32 hashing algorithm and prefixes. The multi-level nested directories have been dropped in favor of single-level nesting made from multiple characters.

Is the improvement substantial? Definitely. Tag cleaning is literally thousands of times faster, loading is twice as fast, and saving is slightly slower dependent on the number of tags being saved.

Test it for yourself with the Magento Cache Benchmark.

Installation

  1. Clone module with modman
  2. Edit app/etc/local.xml changing global/cache/backend to Cm_Cache_Backend_File
  3. Delete all contents of the cache directory

Example Configuration

<config>
    <global>
        <cache>
            <backend>Cm_Cache_Backend_File</backend>
        </cache>
        ...
    </global>
    ...
</config>

By default, Cm_Cache_Backend_File is configured not to use chmod to set file permissions. The proper way to do file permissions is to respect the umask and not set any permissions. This way the file permissions can be properly inherited using the OS conventions. To improve security the umask should be properly set. In Magento the umask is set in index.php as 0 which means no restrictions. So, for example to make files and directories no longer public add umask(0007) to Mage.php.

If umasks are too complicated and you prefer the sub-optimal (less-secure, needless system calls) approach you can enable the legacy chmod usage as seen below. This will force the file modes to be set regardless of the umask.

<config>
    <global>
        <cache>
            <backend>Cm_Cache_Backend_File</backend>
            <backend_options>
                <use_chmod>1</use_chmod>
                <directory_mode>0777</directory_mode>
                <file_mode>0666</file_mode>
            </backend_options>
        </cache>
        ...
    </global>
    ...
</config>

For directory_mode the setgid bit can be set using 2 for the forth digit. E.g. 02770. This will cause files and directories created within the directory with the setgid bit to inherit the same group as the parent which is useful if you run scripts as users other than your web server user. The setgid bit can also be used with the default configuration (use_chmod off) by simply setting the bit on the var/cache directory one time using chmod g+s var/cache.

Note that running your cron job as root is not a good practice from a security standpoint.

Cleaning Old Files

Magento and Zend_Cache do not cleanup old records by themselves so if you want to keep your cache directory tidy you need to write and invoke regularly your own script which cleans the old data. Here is an example for Magento:

<?php PHP_SAPI == 'cli' or die('<h1>:P</h1>');
ini_set('memory_limit','1024M');
set_time_limit(0);
error_reporting(E_ALL | E_STRICT);
require_once 'app/Mage.php';
Mage::app()->getCache()->getBackend()->clean(Zend_Cache::CLEANING_MODE_OLD);
// uncomment this for Magento Enterprise Edition
// Enterprise_PageCache_Model_Cache::getCacheInstance()->getFrontend()->getBackend()->clean(Zend_Cache::CLEANING_MODE_OLD);

Special Thanks

Thanks to Vinai Kopp for the inspiring this backend with your symlink rendition!

@copyright  Copyright (c) 2012 Colin Mollenhour (http://colin.mollenhour.com)
This project is licensed under the "New BSD" license (see source).
Comments
  • Two level mode

    Two level mode

    Hey Colin,

    I am using your optimized file cache, it work great .... i think cause benchmark are good ; ) My conf is the following : two level cache - apc & Cm_Cache_Backend_File

    When i use this conf :

    Cm_Cache_Backend_File

    my cache is generated in directories named this way :

    var/cache/cm--**

    when i use a two-level configuration :

    apc Cm_Cache_Backend_File

    directories looks like this :

    var/cache/mage--0

    it looks like the way magento usually handle cache generation. So am not pretty sure your cache backend is actually used ....

    What's your thinking ? and BTW a big thanks to you for all your work on cache and redis ! and on this one a big thanks to Vinai ;)

    opened by Thorakh 11
  • More TAG files not found in the system.log

    More TAG files not found in the system.log

    Hi Colin

    We having been battling with the following errors that popup up at an alarming rate in our system.log file.

    We have addressed prior issues relating to permissions and ownership file ownership and now all cache files are created with the correct permissions and ownership.

    We are unclear why these errors appear and they seem to go hand in hand with performance issues in the admin interface. Incidentally these errors are limited to our dedicated admin server, the front end server with same code base does not suffer the same issue.

    Given that we use a front end / backend duplicate instance set up should we make the change to use REDIS?

    Any insights you can shed on this would be appreciated.

    Thanks Laurie

    Segment of cache directory - all files owned and with a group of Apache and with permissions 770:-

    drwxrwx--- 2 apache apache 4096 Sep 9 15:59 cm--ed drwxrwx--- 2 apache apache 4096 Sep 9 17:14 cm--ee drwxrwx--- 2 apache apache 4096 Sep 9 17:04 cm--ef drwxrwx--- 2 apache apache 4096 Sep 9 17:04 cm--f0 drwxrwx--- 2 apache apache 4096 Sep 9 17:04 cm--f1 drwxrwx--- 2 apache apache 4096 Sep 9 17:17 cm--f2 drwxrwx--- 2 apache apache 4096 Sep 9 14:51 cm--f3 drwxrwx--- 2 apache apache 4096 Sep 9 14:58 cm--f4 drwxrwx--- 2 apache apache 4096 Sep 9 17:05 cm--f5 drwxrwx--- 2 apache apache 4096 Sep 9 17:17 cm--f6 drwxrwx--- 2 apache apache 4096 Sep 9 15:02 cm--f7 drwxrwx--- 2 apache apache 4096 Sep 9 17:04 cm--f9 drwxrwx--- 2 apache apache 4096 Sep 9 14:48 cm--fa drwxrwx--- 2 apache apache 4096 Sep 9 14:58 cm--fb drwxrwx--- 2 apache apache 4096 Sep 9 15:08 cm--fc drwxrwx--- 2 apache apache 4096 Sep 9 16:51 cm--fd drwxrwx--- 2 apache apache 4096 Sep 9 15:05 cm--fe drwxrwx--- 2 apache apache 4096 Sep 9 17:17 cm--ff drwxrwx--- 2 apache apache 12288 Sep 9 17:17 cm-tags

    Log entires:- 2014-09-09T10:06:41+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:07:53+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:31+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT_18686) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:38+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:38+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT_18686) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT_18684) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT_18684) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:47+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT_18685) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:47+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:47+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_CATALOG_PRODUCT_18685) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:54+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:54+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:54+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:08:54+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:09:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:09:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:09:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:09:43+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-09-09T10:10:13+00:00 DEBUG (7): file_get_contents(httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directoryhttpdocs/.modman/Cm_Cache_Backend_File/File.php

    opened by Flipmediaco 7
  • files cleaning

    files cleaning

    Hello, I've a configured Cm Cache backend File on a FPC, it works well. I was wondering about how Cm File backend do housekeeping, does it remove files when the cache lifetime is over? Currently I've got a huge amount of files 300k in my cache dir, juste want to know if I have to worry about fully filling my var/cache :)

    opened by denos 5
  • Extend the core instead of overwrite the core

    Extend the core instead of overwrite the core

    It seems like this module overwrites the core. I'm trying to avoid that so upgrading the core is simple, so it works with my build process, and the many other reasons altering the core is discouraged by the community.

    In my attempt to refactor the module to extend, I see some things I didn't understand.

    The module symlinks to app/code/community/Cm/Cache/Backend/File.php, but that file doesn't exist, although app/code/community/Cm exists.

    Cm_Cache_Backend_File extends Zend_Cache_Backend_File, but Zend_Cache_Backend_File isn't currently a class in any Magento file.

    The install instructions say change global/cache/backend to Cm_Cache_Backend_File, but I don't see "global/cache/backend" when I ctrl+f app/etc/local.xml. I don't even see "cache" when I ctrl+f.

    Am I fundamentally misunderstanding how this module works? Have things changed in Magento 1.x that this module doesn't support? Any advice for my attempt to refactor this module?

    I am currently on 1.9.2.4, and planning to upgrade soon to 1.9.3.3.

    opened by goosehub 3
  • PHP 7.2 compatibility

    PHP 7.2 compatibility

    You are using each() in File.php:81 which is deprecated in PHP 7.2 and throws a warning. https://wiki.php.net/rfc/deprecations_php_7_2

    Any chance you can update it?

    opened by piotrekkaminski 3
  • Magento Application becoming unresponsive - suspect umask race type issue

    Magento Application becoming unresponsive - suspect umask race type issue

    Hi

    On occasions we have found the Magento application to be failing, after investigation we found the following entries in the system.log:-

    2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directory/var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directory/var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directory/var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directory/var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: No such file or directory/var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_CATALOG_NOTIFYSTOCK) [function.file-get-contents]: failed to open stream: No such file or directory/var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php 2014-06-30T08:47:16+00:00 DEBUG (7): file_get_contents(/var/www/vhosts/domain/httpdocs/var/cache//cm-tags/cm---dbc_BLOCK_HTML_RSS_ORDER_NEW) [function.file-get-contents]: failed to open stream: /var/www/vhosts/domain/httpdocs/.modman/Cm_Cache_Backend_File/File.php

    Our cache directory looked like this at the time of error:-

    drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--c6 drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--c9 drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--cd drwxr-xr-x 2 root root 4096 Jun 30 10:55 cm--cf drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--d0 drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--d6 drwxr-xr-x 2 root root 4096 Jun 30 10:49 cm--dc drwxr-xr-x 2 root root 4096 Jun 30 10:55 cm--dd drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--de drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--e0 drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--e4 drwxrwx--- 2 apache apache 4096 Jun 30 10:48 cm--e7

    Whilst we have umask(0007) set in index.php we did the following to ensure the cache remains readable to all of the Magento applications incarnations...

    In the first instance we made sure cron.php and any instance of the app were run by apache, using the apache cron tab etc, that eliminated the root entires and then we called umask(0007) in Mage.php to ensure all have the correct umask, as Mage.php is always called for all incarnations of the Magento application.

    As of now all entries in our cache directory are owned by apache and have the same permissions and we are waiting for another instance of the race type condition that caused some parts of the application to become unresponsive. Hopefully this has fixed this problem!

    I am posting this for any other insights users and developers may have regarding similar issues.

    Thanks Laurie

    opened by Flipmediaco 3
  • running out of inodes - to many tag files

    running out of inodes - to many tag files

    We had an issue on a customer manager server (so we are not able to install redis or something else).

    there are to many tag file in the tag directory and the hdd running out of inodes.

    possible solution: Files Dispersion, like magento catalog product images eg. media/catalog/product/i/m/image.jpg

    opened by mklooss 3
  • Check file_exists() before file_get_contents()

    Check file_exists() before file_get_contents()

    In an environment with huge numbers of caching files, there are some scripts running to clean up files manually. Because of this, the cache cleanup of Magento is bypassed. And in this circumstance, it happens that the file_get_contents() call is made to a cache file that no longer exists. No harm done because of the @ you might think. Unfortunately, it still triggers an error that is written to the system.log if debugging is enabled. To prevent this from happening, this change simply makes an additional check with file_exists().

    In my own case, the error with file_get_contents() happens so frequently, that the writing to the logs is actually slowing down the server. The downside of having to call file_exists() can be neglected when running a proper PHP accelerator (ZendOPC, APC).

    opened by yireo 2
  • When you call clean('old') you will get your tags wiped out

    When you call clean('old') you will get your tags wiped out

    Due to implementation of _clean method directory traversing it will traverse tags folder as well as regular cache folders.

    When it will go down to tags folder it will wipe out all tag files from that folder, while keeping actual cache records related to those tags.

    This will render tagged cache clearing unusable for those records that survived after clean('old') was called.

    opened by anjey-lobas 2
  • Mongo Cache issue

    Mongo Cache issue

    Sorry for open a ticker for mongodb cache backend here, but theres no issue tracker ;-) https://github.com/colinmollenhour/Cm_Cache_Backend_Mongo

    at the weekend i found out that the cache backend from magento/zend could not delete all old data. so there many data in the mongodb with a expired date.

    so i created my own cronjob to handle this: https://gist.github.com/mklooss/7626105 database size: before: ~50 GB after: ~5 GB

    Mage::app()->getCache()->getBackend()->clean('old');
    

    this script will not find all expired data :/

    opened by mklooss 2
  • Failed opening includes/src/Cm_Cache_Backend_File.php' for inclusion in includes/src/Varien_Autoload.php on line 93

    Failed opening includes/src/Cm_Cache_Backend_File.php' for inclusion in includes/src/Varien_Autoload.php on line 93

    Hi

    This is a 1.7.0.2 install that uses ioncube and zenguard loaders. This is the error message I'm receiving.

    Have not performed a code review as yet, but it is very slow to load the home page...

    Any ideas?

    Steve

    opened by sholdowa 2
  • Trying to access array offset on value of type bool in vendor/colinmollenhour/cache-backend-file/File.php on line 149

    Trying to access array offset on value of type bool in vendor/colinmollenhour/cache-backend-file/File.php on line 149

    Hi!

    Using:

    • PHP 7.4.33
    • Magento 2.4.3-p3 (Update, we moved this shop to Magento 2.4.5-p1 and PHP 8.1 and it still happened after yet another server crash)
    • colinmollenhour/cache-backend-file 1.4.5

    I noticed this error:

    [2022-11-19 12:39:58] .CRITICAL: Notice: Trying to access array offset on value of type bool in vendor/colinmollenhour/cache-backend-file/File.php on line 149 [] []
    

    This happened shortly after the hosting brought back a server to live, after it had crashed. So possibly some cached data could have been corrupted or something (this is just guessing).

    Flushing the Magento cache stopped it from occurring.

    This code probably needs more defensive code to prevent this warning and to do the right thing to make sure the cache is no longer corrupted?

    opened by hostep 0
Releases(v1.4.5)
Owner
Colin Mollenhour
Colin Mollenhour
Magento 2 - Improved Import / Export extension

Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!

Firebear Studio 173 Dec 17, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021
php String Objects Chains like length,forEach,filter,replace,repalcAll much More.... Module

php String Objects Chains like length,forEach,filter,replace,repalcAll much More.... Module

im__koli 1 Mar 29, 2022
A great Start for your next Magento Theme's local.xml file

Magento-local.xml-Template A Great Start for your next Magento Theme's local.xml file - <?xml version="1.0"?> <layout> <!-- Add/Remove Items From H

Bryan Littlefield 36 Apr 19, 2021
A drop-in replacement for the Magento 2 checkout.

Clean Checkout for Magento 2 A drop-in replacement for the Magento 2 checkout. Features Modules The project is divided into several modules: Overall c

Daniel Sloof 275 Sep 14, 2022
A faster drop in replacement for bin/magento cache:clean with file watcher

"You know, hope is a mistake. If you can't fix what's broken, you'll, uh... you'll go insane." - Max Rockatansky Magento 2 Cache Clean A faster drop i

mage2tv 460 Dec 26, 2022
An improved version of the PHP port of KuzuhaScript

KuzuhaScriptPHP+ (くずはすくりぷとPHP+) An improved version of the PHP port of KuzuhaScript (くずはすくりぷと). To my knowledge, it works with PHP version 4.1.0 and a

Heyuri 4 Nov 16, 2022
This is a replacement dashboard for the Pisces Helium Miner

Pisces QoL Dashboard This is a replacement dashboard for the Pisces Helium Miner. The dashboard that ships with the Pisces P100 has a number of securi

null 42 Jun 16, 2022
Easily create WooCommerce replacement orders for your customers.

Support Orders for WooCommerce Requires PHP: 7.0 WP requires at least: 5.7 WP tested up to: 5.7 WC requires at least: 5.6.0 WC tested up to: 5.8.0 Sta

DevPress 5 Feb 24, 2022
A replacement for Octoprint's UI and for multiple printers.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Andy Newhouse 1 Jan 19, 2022
Igbinary is a drop in replacement for the standard php serializer.

igbinary Igbinary is a drop in replacement for the standard php serializer. Instead of the time and space consuming textual representation used by PHP

Igbinary development 727 Dec 21, 2022
A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.

select2entity-bundle Introduction This is a Symfony bundle which enables the popular Select2 component to be used as a drop-in replacement for a stand

Ross Keatinge 214 Nov 21, 2022
A powerful and pretty replacement for PHP's var_export()

Brick\VarExporter A powerful and pretty replacement for PHP's var_export(). Introduction PHP's var_export() function is a handy way to export a variab

Brick 145 Dec 23, 2022
GDPR compliant TYPO3 content elements which work great with PIWIK Consent Manager.

PIWIK Consent Manager TYPO3 extension PIWIK Consent Manager integration in order to make TYPO3 content elements GDPR compliant. You can click on the i

null 6 Aug 8, 2022
Get the system resources in PHP, as memory, number of CPU'S, Temperature of CPU or GPU, Operating System, Hard Disk usage, .... Works in Windows & Linux

system-resources. A class to get the hardware resources We can get CPU load, CPU/GPU temperature, free/used memory & Hard disk. Written in PHP It is a

Rafael Martin Soto 10 Oct 15, 2022
This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform

This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform. It allows you to hear the sound

Thành Nhân 10 Sep 27, 2022
A payment gateway plugin for WooCommerce to see if your checkout works.

=== Order Test For All for WooCommerce === Contributors: ikamal Donate link: https://kamal.pw/ Tags: wc order test, wc order, woocommerce, woocommerce

Kamal 3 Dec 7, 2021
This package is aimed to be a simplistic PHP workflow package that works in a similar fashion to GitHub Actions.

Workflow This package is aimed to be a simplistic PHP workflow package that works in a similar fashion to GitHub Actions. Installation To install this

Steve McDougall 4 Sep 26, 2022