Cherrycake
ExamplesGithub
version 2.x alpha
version 2.x alpha
  • Introduction
  • Status
  • Changelog
  • Migration
  • Architecture
    • Basics
    • Modules
    • Classes
    • Lifecycle
      • Deep lifecycle
    • Performance
    • Security
    • Patterns
      • Files structure
    • Items
    • Server requirements
  • Guide
    • Getting started
      • Skeleton start
      • Docker start
    • Modules guide
    • Classes guide
    • Actions guide
      • Complex actions
      • Variable path components
      • Accept GET or POST parameters
      • Getting the URL of an action
      • Cached actions
      • Brute force attacks
    • Patterns guide
      • Passing variables to a pattern
      • Nested patterns
      • Cached patterns
    • Cache guide
      • Time To Live
      • Using cache
      • Lists
      • Queues
      • Pools
    • Database guide
      • Basic queries
      • Prepared queries
      • Cached queries
      • Cache key naming
      • Removing queries from cache
    • Items guide
      • Item cache
      • Item lists
      • Items custom filters
      • Items custom ordering
      • Mixing filters and ordering
      • Items with relationships
      • Items cache
    • HtmlDocument guide
    • Css and Javascript guide
      • Modules injecting CSS and JavaScript
    • Session guide
    • Login guide
      • Creating a complete login workflow
    • Locale guide
      • Multilingual texts
      • Domain based site localization
    • Log guide
      • Loading Log events from the database
    • Stats guide
      • Stats events with additional dimensions
      • Loading Stats events from the database
    • Janitor guide
      • Janitor tasks configuration files
    • Command line interface
    • Debugging
  • Reference
    • Core modules
      • Actions
        • Actions methods
      • Browser
      • Cache
        • Cache methods
      • Css
        • Css methods
      • Database
      • Email
      • Errors
      • HtmlDocument
        • HtmlDocument methods
      • ItemAdmin
      • Janitor
        • Janitor methods
      • Javascript
        • Javascript methods
      • Locale
        • Locale methods
      • Log
        • Log methods
      • Login
        • Login methods
      • Output
        • Output methods
      • Patterns
        • Patterns methods
      • Security
        • Security methods
      • Session
        • Session methods
      • Stats
        • Stats methods
      • SystemLog
      • TableAdmin
      • Translation
      • Validate
    • Core classes
      • Action
        • Action methods
        • Action properties
      • AjaxResponseJson
      • BasicObject
        • BasicObject methods
      • CacheProvider
        • CacheProvider methods
      • Color
      • DatabaseProvider
        • DatabaseProvider methods
      • DatabaseResult
        • DatabaseResult methods
        • DatabaseResult properties
      • DatabaseRow
      • Engine
        • Engine methods
        • Engine properties
      • Gradient
      • Item
        • Item methods
        • Item properties
      • Items
        • Items methods
        • Items properties
      • Image
      • JanitorTask
        • JanitorTask methods
        • JanitorTask properties
      • LogEvent
        • LogEvent methods
        • LogEvent Properties
      • LogEvents
        • LogEvents methods
      • Module
        • Module methods
        • Module properties
      • Response
      • Request
        • Request methods
      • RequestParameter
        • RequestParameter methods
      • RequestPathComponent
        • RequestPathComponent methods
      • Result
      • StatsEvent
        • StatsEvent properties
      • StatsEvents
        • StatsEvents methods
      • SystemLogEvent
        • SystemLogEvent methods
        • SystemLogEvent properties
      • SystemLogEvents
        • SystemLogEvents methods
  • Code conventions
  • License
  • Extras
Powered by GitBook
On this page
  • Configuration
  • Constants

Was this helpful?

  1. Reference
  2. Core modules

Cache

Provides a standardized interface to implement caching and shared memory mechanisms into an App by connecting to multiple external cache providers.

PreviousBrowserNextCache methods

Last updated 5 years ago

Was this helpful?

See the to learn how to work with the Cache module.

Configuration

  • providers A hash array of the available , where the key is the name of the cache provider, and the value is a hash array with the following possible keys:

    • providerClassName The name of the cache provider class, from the available ones:

      • CacheProviderApc

      • CacheProviderApcu

      • CacheProviderMemcached

      • CacheProviderRedis

    • config A hash array of configuration options for the cache provider, where each different cache provider has different available config keys:

      • For CacheProviderApc: No configuration needed.

      • For CacheProviderApcu: No configuration needed.

      • For CacheProviderMemcached:

        • isPersistentConnection

        • isCompression

        • servers An array of the servers to add to the server Memcached pool, as documented in

      • For CacheProviderRedis:

        • scheme The connection scheme. Default: tcp

        • host The host name or IP of the Redis server. Default: localhost

        • port The server port. Default: 6379

        • database The Redis database number to use. Default: 0

        • prefix The prefix to use for all cache keys. Used to avoid key collisions with other apps that might be running in the server. Defaults to none.

        • isPersistentConnection Whether to keep the connection to Redis active between requests. Default: true

Constants

  • CACHE_TTL_1_MINUTE

  • CACHE_TTL_5_MINUTES

  • CACHE_TTL_10_MINUTES

  • CACHE_TTL_30_MINUTES

  • CACHE_TTL_1_HOUR

  • CACHE_TTL_2_HOURS

  • CACHE_TTL_6_HOURS

  • CACHE_TTL_12_HOURS

  • CACHE_TTL_1_DAY

  • CACHE_TTL_2_DAYS

  • CACHE_TTL_3_DAYS

  • CACHE_TTL_5_DAYS

  • CACHE_TTL_1_WEEK

  • CACHE_TTL_2_WEEKS

  • CACHE_TTL_1_MONTH

  • CACHE_TTL_MINIMAL 10 seconds

  • CACHE_TTL_CRITICAL 1 minute

  • CACHE_TTL_SHORT 5 minutes

  • CACHE_TTL_NORMAL 1 hour

  • CACHE_TTL_UNCRITICAL 1 day

  • CACHE_TTL_LONG 1 week

  • CACHE_TTL_LONGEST 1 month

Cache guide
https://www.php.net/manual/en/memcached.addservers.php
cache providers