<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.php.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'book.yac.php',
    1 => 'Yac',
    2 => 'Yac',
  ),
  'up' => 
  array (
    0 => 'refs.basic.php.php',
    1 => 'PHP\'nin Davranışını Etkileyenler',
  ),
  'prev' => 
  array (
    0 => 'function.xhprof-sample-enable.php',
    1 => 'xhprof_sample_enable',
  ),
  'next' => 
  array (
    0 => 'yac.setup.php',
    1 => 'Yapılandırma/Kurulum',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yac/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.yac.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.yac" class="book">
 
 <h1 class="title">Yac</h1>
 

 <div id="intro.yac" class="preface">
  <h1 class="title">Giriş</h1>
  <p class="simpara">
   Yac (Yet Another Cache) is a lock-free, shared memory user data cache,
   and can be used to replace APC or local memcached.
  </p>
  <p class="simpara">
   Yac stores data in shared memory, which makes it visible to every PHP
   worker of the same machine without any inter-process communication.
   Instead of locking, Yac relies on atomic slot updates plus a few
   collision probes, so a cache miss never blocks a request, and a
   concurrent write can at worst cause a failed store or a missed read
   that the caller can simply retry.
  </p>
  <p class="simpara">
   With no locks and no inter-process communication in the access
   path, a read is essentially a hash lookup in shared memory. As a
   result, Yac is extremely fast, with microsecond-level read
   latency, and its throughput can scale with the number of
   workers as long as writes are spread across keys; see the
   <a href="https://github.com/laruence/yac/blob/master/README.md#benchmarks" class="link external">&raquo;&nbsp;benchmarks</a>.
  </p>
  <p class="simpara">
   Because Yac trades correctness guarantees for speed and throughput,
   it is best suited for data that is expensive to produce but easy to
   recreate: page fragments, configuration snapshots, small service
   responses, and other local caches. It should not be used as the
   authoritative store for irreplaceable data.
  </p>
  <p class="simpara">
   As of yac 2.4.0, small scalar values —
   <strong><code><a href="reserved.constants.php#constant.null">NULL</a></code></strong>, booleans, most integers (those that fit in
   60 signed bits on 64-bit builds), strings of up to 7 bytes and empty
   arrays — are stored directly inside the hash slot
   instead of in a separate value block (&quot;embedded values&quot;), which
   removes the value-memory allocation and block copy on every access
   and significantly improves performance while reducing memory usage.
   Version 2.4.0 also switched the compression backend from FastLZ to
   LZ4, making compressed reads several times faster.
  </p>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <p class="simpara">
    Shared memory is only visible within one machine. To share a cache
    across several servers, use a network cache such as Memcached or
    Redis instead.
   </p>
  </p></blockquote>
 </div>

 






 






 






 
 







<ul class="chunklist chunklist_book"><li><a href="yac.setup.php">Yapılandırma/Kurulum</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="yac.requirements.php">Gereksinimler</a></li><li><a href="yac.installation.php">Kurulum</a></li><li><a href="yac.configuration.php">&Ccedil;alışma Anı Yapılandırması</a></li><li><a href="yac.resources.php">&Ouml;zkaynak T&uuml;rleri</a></li></ul></li><li><a href="yac.memory-management.php">Memory Management</a></li><li><a href="yac.constants.php">&Ouml;ntanımlı Sabitler</a></li><li><a href="class.yac.php">Yac</a> — The Yac class<ul class="chunklist chunklist_book chunklist_children"><li><a href="yac.add.php">Yac::add</a> — Store a value without overwriting an existing one</li><li><a href="yac.construct.php">Yac::__construct</a> — Constructor</li><li><a href="yac.delete.php">Yac::delete</a> — Remove items from cache</li><li><a href="yac.dump.php">Yac::dump</a> — Dump cache entries for inspection</li><li><a href="yac.flush.php">Yac::flush</a> — Flush the cache</li><li><a href="yac.get.php">Yac::get</a> — Retrieve values from cache</li><li><a href="yac.getter.php">Yac::__get</a> — Retrieve a value using property syntax</li><li><a href="yac.info.php">Yac::info</a> — Status of cache</li><li><a href="yac.set.php">Yac::set</a> — Store a value into the cache</li><li><a href="yac.setter.php">Yac::__set</a> — Store a value using property syntax</li></ul></li></ul></div><?php manual_footer($setup); ?>