Class **Phalcon\\Cache\\Frontend\\Base64** ========================================== *implements* :doc:`Phalcon\\Cache\\FrontendInterface ` .. role:: raw-html(raw) :format: html :raw-html:`Source on GitHub` Allows to cache data converting/deconverting them to base64. This adapter uses the base64_encode/base64_decode PHP's functions .. code-block:: php 172800, ] ); //Create a MongoDB cache $cache = new \Phalcon\Cache\Backend\Mongo( $frontCache, [ "server" => "mongodb://localhost", "db" => "caches", "collection" => "images", ] ); $cacheKey = "some-image.jpg.cache"; // Try to get cached image $image = $cache->get($cacheKey); if ($image === null) { // Store the image in the cache $cache->save( $cacheKey, file_get_contents("tmp-dir/some-image.jpg") ); } header("Content-Type: image/jpeg"); echo $image; Methods ------- public **__construct** ([*array* $frontendOptions]) Phalcon\\Cache\\Frontend\\Base64 constructor public **getLifetime** () Returns the cache lifetime public **isBuffering** () Check whether if frontend is buffering output public **start** () Starts output frontend. Actually, does nothing in this adapter public *string* **getContent** () Returns output cached content public **stop** () Stops output frontend public **beforeStore** (*mixed* $data) Serializes data before storing them public **afterRetrieve** (*mixed* $data) Unserializes data after retrieval