summaryrefslogtreecommitdiff
path: root/core/classes/cache/FileCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/classes/cache/FileCache.php')
-rw-r--r--core/classes/cache/FileCache.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/core/classes/cache/FileCache.php b/core/classes/cache/FileCache.php
index fb7eee5..fe4a4e4 100644
--- a/core/classes/cache/FileCache.php
+++ b/core/classes/cache/FileCache.php
@@ -1,20 +1,26 @@
<?php
/* FileCache
- * ---
+ * -----------------------------------------------------------------------------
+ *
* Saves serialized data into filesystem.
- * Use it for expensive database-queries.
- * Performanve on a NVMe-SSD drive is really great;
- * (even better than MemCached and Redis)
- * performance on a typical HDD is just fair.
+ *
+ * Use it for repetitive expensive database-queries
+ * or other common time/source-consuming tasks
+ *
+ * Performance on a local NVMe-SSD drive can be great;
+ * Performance on a typical HDD is just fair.
*
* NOTE:
* Memcached and Redis are much faster cache-technologies
- * and generally recommended; but they are not always available;
+ * (when implemented locally) but not always available;
* FileCache is (almost) always available;
*
- * Before tou decide on your caching technology
- * run some benchmarks.
+ * RECOMMENDATION:
+ * Before you decide on your actual caching technology
+ * design and run a few comparative benchmarks
+ *
+ * -----------------------------------------------------------------------------
*/
class FileCache implements Cache_interface
{
@@ -28,7 +34,7 @@ class FileCache implements Cache_interface
{
// filename is a hashed 48-hex-digit string
// probability of collision = exp( (-k*(k-1)) / 2N )
- // ex: for 10tril.samples P(collision) = 1.5E-11%
+ // example case: for 10tril.samples P(collision) = 1.5E-11
$filename = FILECACHE_PATH . sha1($key);
// Opening file for write