Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15307094
D16993.id40884.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16993.id40884.diff
View Options
diff --git a/src/applications/cache/PhabricatorCaches.php b/src/applications/cache/PhabricatorCaches.php
--- a/src/applications/cache/PhabricatorCaches.php
+++ b/src/applications/cache/PhabricatorCaches.php
@@ -117,6 +117,42 @@
}
+/* -( Runtime Cache )------------------------------------------------------ */
+
+
+ /**
+ * Get a runtime cache stack.
+ *
+ * This stack is just APC. It's fast, it's effectively immutable, and it
+ * gets thrown away when the webserver restarts.
+ *
+ * This cache is suitable for deriving runtime cache, like a map of Conduit
+ * method names to provider classes.
+ *
+ * @return PhutilKeyValueCacheStack Best runtime stack available.
+ */
+ public static function getRuntimeCache() {
+ static $cache;
+ if (!$cache) {
+ $caches = self::buildRuntimeCaches();
+ $cache = self::newStackFromCaches($caches);
+ }
+ return $cache;
+ }
+
+
+ private static function buildRuntimeCaches() {
+ $caches = array();
+
+ $apc = new PhutilAPCKeyValueCache();
+ if ($apc->isAvailable()) {
+ $caches[] = $apc;
+ }
+
+ return $caches;
+ }
+
+
/* -( Repository Graph Cache )--------------------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 4:44 AM (16 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7319963
Default Alt Text
D16993.id40884.diff (1 KB)
Attached To
Mode
D16993: Provide a pure APC cache for runtime caching
Attached
Detach File
Event Timeline
Log In to Comment