Git Product home page Git Product logo

module-compressed_cache's Introduction

Compressed Database Cache Backend

This package provides a cache backend which leverages gzip compression for the stored data.

Upon cache set the cache data will be gzipped, if the gzipped data is smaller than the original data the compressed data will be stored in the cache bin.

This Database Backend adds two additional states to serialized column of Drupal cores DatabaseBackend.

  • SERIALIZED_COMPRESSED (2): a serialized object, compressed.
  • STRING_SERIALIZED_COMPRESSED (3): a compressed string.

Requirements

php functions: gzcompress, gzuncompress come with zlib extension.

Installation

in settings.php:

// Default cache bin
$settings['cache']['default'] = 'cache.backend.database_compressed_cache';
// Specific cache bins
$settings['cache']['bins']['data'] = 'cache.backend.database_compressed_cache';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.database_compressed_cache';
$settings['cache']['bins']['render'] = 'cache.backend.database_compressed_cache';
$settings['cache']['bins']['page'] = 'cache.backend.database_compressed_cache';

Advanced settings

/**
 * Compression level
 * default = 6
 * @see http://php.net/gzcompress
 */
$settings['compressed_cache']['cache_compression_ratio'] = 1;

/**
 * Minimum string length to add compression.
 * Seems to be completely based on gut feeling. can not find any sources googling this topic.
 */
$settings['compressed_cache']['cache_compression_size_threshold'] = 100;

/**
 * Whether garbage collection is enabled or not. Defaults to TRUE.
 */
$settings['compressed_cache']['garbage_collection_enabled'] = TRUE;

module-compressed_cache's People

Contributors

andrebaumeier avatar gaelg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.