Created
January 8, 2016 06:38
-
-
Save kvalexandr/37ac258ea0393d738ecc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cacheId = 'uniqueCacheId'; | |
$cacheTtl = '3600'; | |
$cache = \Bitrix\Main\Application::getInstance()->getManagedCache(); | |
if ($cache->read($cacheTtl, $cacheId)) { | |
$data = $cache->get($cacheId); // get our data | |
} else { | |
$data = '12345678'; | |
$cache->set($cacheId, $data); // set our cache | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment